X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=preprocessor.c;h=e876e993ac05d47690de0b690d8eda71103d2ef0;hb=3def71f59901789159be20bfdc806fb0fb1b6375;hp=95743dc9ee8f41d51b1c074d430a1e960a8daa16;hpb=f56ee1a34627fb21c5909086f3597c76ce9583be;p=cparser diff --git a/preprocessor.c b/preprocessor.c index 95743dc..e876e99 100644 --- a/preprocessor.c +++ b/preprocessor.c @@ -221,7 +221,7 @@ static inline void put_back(int pc) ++input.position.lineno; \ code -#define eat(c_type) do { assert(CC == c_type); next_char(); } while(0) +#define eat(c_type) (assert(CC == c_type), next_char()) static void maybe_concat_lines(void) { @@ -1392,8 +1392,7 @@ static void parse_define_directive(void) pp_definition_t *old_definition = symbol->pp_definition; if (old_definition != NULL) { if (!pp_definitions_equal(old_definition, new_definition)) { - warningf(&input.position, "multiple definition of macro '%Y' (first defined %P)", - symbol, &old_definition->source_position); + warningf(WARN_OTHER, &input.position, "multiple definition of macro '%Y' (first defined %P)", symbol, &old_definition->source_position); } else { /* reuse the old definition */ obstack_free(&pp_obstack, new_definition); @@ -1428,7 +1427,7 @@ static void parse_undef_directive(void) next_preprocessing_token(); if(pp_token.type != '\n') { - warningf(&input.position, "extra tokens at end of #undef directive"); + warningf(WARN_OTHER, &input.position, "extra tokens at end of #undef directive"); } /* eat until '\n' */ eat_pp_directive(); @@ -1524,8 +1523,7 @@ static bool parse_include_directive(void) } if (pp_token.type != '\n' && pp_token.type != TP_EOF) { - warningf(&pp_token.source_position, - "extra tokens at end of #include directive"); + warningf(WARN_OTHER, &pp_token.source_position, "extra tokens at end of #include directive"); eat_pp_directive(); } @@ -1641,7 +1639,7 @@ static void parse_else_directive(void) if (pp_token.type != '\n') { if (!skip_mode) { - warningf(&pp_token.source_position, "extra tokens at end of #else"); + warningf(WARN_OTHER, &pp_token.source_position, "extra tokens at end of #else"); } eat_pp_directive(); } @@ -1673,8 +1671,7 @@ static void parse_endif_directive(void) if (pp_token.type != '\n') { if (!skip_mode) { - warningf(&pp_token.source_position, - "extra tokens at end of #endif"); + warningf(WARN_OTHER, &pp_token.source_position, "extra tokens at end of #endif"); } eat_pp_directive(); }