while (CurC != '*' || NextC != '/') {
if (CurC == '\0') {
if (NextLine () == 0) {
- PPError (ERR_EOF_IN_COMMENT, StartingLine);
+ PPError ("End-of-file reached in comment starting at line %u",
+ StartingLine);
return;
}
} else {
if (CurC == '/' && NextC == '*') {
- PPWarning (WARN_NESTED_COMMENT);
+ PPWarning ("`/*' found inside a comment");
}
NextChar ();
}
/* Get macro symbol name. If error, print message and clear line. */
{
if (IsSym (Ident) == 0) {
- PPError (ERR_IDENT_EXPECTED);
+ PPError ("Identifier expected");
ClearLine ();
return 0;
} else {
/* Expect an argument list */
SkipBlank ();
if (CurC != '(') {
- PPError (ERR_ILLEGAL_MACRO_CALL);
+ PPError ("Illegal macro call");
return 0;
}
/* Compare formal argument count with actual */
if (M->ArgCount != ArgCount) {
- PPError (ERR_MACRO_ARGCOUNT);
+ PPError ("Macro argument count mismatch");
/* Be sure to make enough empty arguments available */
while (ArgCount < M->ArgCount) {
M->ActualArgs [ArgCount++] = "";
/* Check for a right paren and eat it if we find one */
if (CurC != ')') {
- PPError (ERR_RPAREN_EXPECTED);
+ PPError ("`)' expected");
ClearLine ();
return;
}
*/
if (Existing) {
if (MacroCmp (M, Existing) != 0) {
- PPError (ERR_MACRO_REDEF);
+ PPError ("Macro redefinition is not identical");
}
}
}
SkipBlank();
}
if (!IsIdent (CurC)) {
- PPError (ERR_IDENT_EXPECTED);
+ PPError ("Identifier expected");
*mptr++ = '0';
} else {
SymName (Ident);
if (HaveParen) {
SkipBlank();
if (CurC != ')') {
- PPError (ERR_RPAREN_EXPECTED);
+ PPError ("`)' expected");
} else {
NextChar ();
}
break;
default:
- PPError (ERR_INCLUDE_LTERM_EXPECTED);
+ PPError ("`\"' or `<' expected");
goto Done;
}
NextChar ();
/* Check if we got a terminator */
if (CurC != RTerm) {
/* No terminator found */
- PPError (ERR_INCLUDE_RTERM_EXPECTED);
+ PPError ("Missing terminator or file name too long");
goto Done;
}
{
SkipBlank ();
if (CurC == '\0') {
- PPError (ERR_INVALID_USER_ERROR);
+ PPError ("Invalid #error directive");
} else {
- PPError (ERR_USER_ERROR, lptr);
+ PPError ("#error: %s", lptr);
}
/* clear rest of line */
continue;
}
if (!IsSym (Directive)) {
- PPError (ERR_CPP_DIRECTIVE_EXPECTED);
+ PPError ("Preprocessor directive expected");
ClearLine ();
} else {
switch (searchtok (Directive, pre_toks)) {
}
s_ifdef[i_ifdef] ^= 2;
} else {
- PPError (ERR_UNEXPECTED_CPP_ELSE);
+ PPError ("Unexpected `#else'");
}
break;
if (i_ifdef >= 0) {
Skip = s_ifdef[i_ifdef--] & 1;
} else {
- PPError (ERR_UNEXPECTED_CPP_ENDIF);
+ PPError ("Unexpected `#endif'");
}
break;
case PP_LINE:
/* Not allowed in strict ANSI mode */
if (ANSI) {
- PPError (ERR_CPP_DIRECTIVE_EXPECTED);
+ PPError ("Preprocessor directive expected");
ClearLine ();
}
break;
break;
default:
- PPError (ERR_CPP_DIRECTIVE_EXPECTED);
+ PPError ("Preprocessor directive expected");
ClearLine ();
}
}
}
if (NextLine () == 0) {
if (i_ifdef >= 0) {
- PPError (ERR_CPP_ENDIF_EXPECTED);
+ PPError ("`#endif' expected");
}
return;
}