From: Dale Weiler Date: Mon, 17 Dec 2012 16:14:04 +0000 (+0000) Subject: Added -Wunknown-pragmas X-Git-Tag: 0.1.9~80 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8e0515de44096570d40d653ee155c9de9474e80a;p=xonotic%2Fgmqcc.git Added -Wunknown-pragmas --- diff --git a/main.c b/main.c index 871e3e7..4032264 100644 --- a/main.c +++ b/main.c @@ -552,6 +552,7 @@ int main(int argc, char **argv) { options_set(opts.warn, WARN_DOUBLE_DECLARATION, true); options_set(opts.warn, WARN_CONST_VAR, true); options_set(opts.warn, WARN_MULTIBYTE_CHARACTER, true); + options_set(opts.warn, WARN_UNKNOWN_PRAGMAS, true); options_set(opts.flags, ADJUST_VECTOR_FIELDS, true); options_set(opts.flags, FTEPP, false); diff --git a/opts.def b/opts.def index 79809b8..f1adc7a 100644 --- a/opts.def +++ b/opts.def @@ -66,6 +66,7 @@ GMQCC_DEFINE_FLAG(CONST_VAR) GMQCC_DEFINE_FLAG(MULTIBYTE_CHARACTER) GMQCC_DEFINE_FLAG(TERNARY_PRECEDENCE) + GMQCC_DEFINE_FLAG(UNKNOWN_PRAGMAS) #endif #ifdef GMQCC_TYPE_OPTIMIZATIONS diff --git a/parser.c b/parser.c index 4a1933b..8e5f8b0 100644 --- a/parser.c +++ b/parser.c @@ -2479,7 +2479,7 @@ static bool parse_pragma_do(parser_t *parser) } else { - parseerror(parser, "unrecognized hash-keyword: `%s`", parser_tokval(parser)); + (void)!parsewarning(parser, WARN_UNKNOWN_PRAGMAS, "ignoring #pragma %s", parser_tokval(parser)); return false; }