Thanks for the suggestions. I have found a code solution, but have no clue at present why it matters to the VS2012 compiler. A bit of history: the app is a language interpreter I first wrote in 1992 with VC4. The code base progressed through VC5,VC6,VS2003 and VS2008, and the relevant section of code never required updating until I switched to VS2012.
The interpreter uses
extern LPSTR lpScriptIP;
BOOL CheckPointLabel (VOID)
{
extern LPSTR lpScriptIP;
if (FALSE == CheckPointIdentifier ())
{
return (FALSE);
}
--lpScriptIP;
if (FALSE == CheckCharEOL_new (lpScriptIP))
{
return (FALSE);
}
++lpScriptIP;
ScanIdentifierEnd();
if (*lpScriptIP != CHAR_LABEL_END)
return (FALSE);
++lpScriptIP;
return (TRUE);
}
BOOL CheckCharEOL_old (VOID)
{
extern LPSTR lpScriptIP;
switch (*lpScriptIP)
{
case CHAR_CR:
case CHAR_LF:
case CHAR_EOF:
return (TRUE);
default:
return (FALSE);
}
}
BOOL CheckCharEOL_new (LPSTR lpScript)
{
switch (*lpScript)
{
case CHAR_CR:
case CHAR_LF:
case CHAR_EOF:
return (TRUE);
default:
return (FALSE);
}
}
I'm at a loss to explain why VS2012 Release mode has a problem with this. The solution I now have has passed all the language interpreter tests, so I'm happy to leave it alone for now.
It's almost as though the lpScriptIP was not being decremented before it was passed to the CheckCharEOL_old() function.
All theories to explain this are appreciated. The app language is called PiXCL.