Add seperate warning flag for directive in macro.

This commit is contained in:
Dale Weiler 2013-09-30 15:59:36 -04:00
parent 8f359f3849
commit 90824c2093
3 changed files with 3 additions and 1 deletions

View file

@ -1525,7 +1525,7 @@ static bool ftepp_else_allowed(ftepp_t *ftepp)
static GMQCC_INLINE void ftepp_inmacro(ftepp_t *ftepp, const char *hash) {
if (ftepp->in_macro)
(void)!ftepp_warn(ftepp, WARN_CPP, "`#%s` directive in macro", hash);
(void)!ftepp_warn(ftepp, WARN_DIRECTIVE_INMACRO, "`#%s` directive in macro", hash);
}
static bool ftepp_hash(ftepp_t *ftepp)

1
opts.c
View file

@ -91,6 +91,7 @@ static void opts_setdefault(void) {
opts_set(opts.warn, WARN_DEPRECATED, true);
opts_set(opts.warn, WARN_PARENTHESIS, true);
opts_set(opts.warn, WARN_CONST_OVERWRITE, true);
opts_set(opts.warn, WARN_DIRECTIVE_INMACRO, true);
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);

View file

@ -95,6 +95,7 @@
GMQCC_DEFINE_FLAG(UNSAFE_TYPES)
GMQCC_DEFINE_FLAG(BREAKDEF)
GMQCC_DEFINE_FLAG(CONST_OVERWRITE)
GMQCC_DEFINE_FLAG(DIRECTIVE_INMACRO)
#endif
#ifdef GMQCC_TYPE_OPTIMIZATIONS