added -Wcpp (for turning off cpp warnings defined with #warning like GCC/clang/pathscale .. no more [-Wunused-variable])

This commit is contained in:
Dale Weiler 2012-12-21 03:12:58 +00:00
parent 36a90bb866
commit f78ab9061b
3 changed files with 4 additions and 2 deletions

View file

@ -1025,13 +1025,13 @@ static void ftepp_directive_warning(ftepp_t *ftepp) {
ftepp_next(ftepp);
}
vec_push(message, '\0');
(void)!!ftepp_warn(ftepp, LVL_WARNING, message);
(void)!!ftepp_warn(ftepp, WARN_CPP, message);
vec_free(message);
return;
}
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
(void)!!ftepp_warn(ftepp, LVL_WARNING, "#warning %s", ftepp_tokval(ftepp));
(void)!!ftepp_warn(ftepp, WARN_CPP, "#warning %s", ftepp_tokval(ftepp));
}
static void ftepp_directive_error(ftepp_t *ftepp) {

1
opts.c
View file

@ -52,6 +52,7 @@ static void opts_setdefault() {
opts_set(opts.warn, WARN_MULTIBYTE_CHARACTER, true);
opts_set(opts.warn, WARN_UNKNOWN_PRAGMAS, true);
opts_set(opts.warn, WARN_UNREACHABLE_CODE, true);
opts_set(opts.warn, WARN_CPP, true);
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);
opts_set(opts.flags, FTEPP, false);

View file

@ -72,6 +72,7 @@
GMQCC_DEFINE_FLAG(TERNARY_PRECEDENCE)
GMQCC_DEFINE_FLAG(UNKNOWN_PRAGMAS)
GMQCC_DEFINE_FLAG(UNREACHABLE_CODE)
GMQCC_DEFINE_FLAG(CPP)
#endif
#ifdef GMQCC_TYPE_OPTIMIZATIONS