Reporting also pre-processing errors

This commit is contained in:
Pierre Pronchery 2008-03-11 17:48:11 +00:00
parent 2ef284cec7
commit 92247055fa
2 changed files with 9 additions and 1 deletions

View File

@ -114,7 +114,7 @@ static int _parse_error(C99 * c99, char const * format, ...)
Token * token = c99->token;
va_list ap;
fprintf(stderr, "%s%s:%u, near \"%s\": ", PACKAGE ": ",
fprintf(stderr, "%s%s:%u, near \"%s\": error: ", PACKAGE ": ",
token_get_filename(token), token_get_line(token),
token_get_string(token));
va_start(ap, format);

View File

@ -20,6 +20,7 @@
#include <ctype.h>
#include "common.h"
#include "c99.h"
#include "../config.h"
/* private */
@ -108,6 +109,13 @@ static int _scan_skip_meta(C99 * c99)
&& (code < C99_CODE_META_FIRST
|| code > C99_CODE_META_LAST))
break;
if(code == C99_CODE_META_ERROR || code == C99_CODE_META_WARNING)
fprintf(stderr, "%s%s%s%u%s%s%s%s\n", PACKAGE ": ",
token_get_filename(c99->token), ":",
token_get_line(c99->token), ": ",
(code == C99_CODE_META_ERROR)
? "error" : "warning", ": ",
token_get_string(c99->token));
token_delete(c99->token);
}
return ret;