From 90824c209329d73b9bdad86177348d18562891ab Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Mon, 30 Sep 2013 15:59:36 -0400 Subject: [PATCH] Add seperate warning flag for directive in macro. --- ftepp.c | 2 +- opts.c | 1 + opts.def | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ftepp.c b/ftepp.c index a2bbb68..050d6d8 100644 --- a/ftepp.c +++ b/ftepp.c @@ -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) diff --git a/opts.c b/opts.c index 9aa8f63..27d6a56 100644 --- a/opts.c +++ b/opts.c @@ -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); diff --git a/opts.def b/opts.def index f4d01e6..57625dd 100644 --- a/opts.def +++ b/opts.def @@ -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 -- 2.39.2