]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Add seperate warning flag for directive in macro.
authorDale Weiler <killfieldengine@gmail.com>
Mon, 30 Sep 2013 19:59:36 +0000 (15:59 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 30 Sep 2013 19:59:36 +0000 (15:59 -0400)
ftepp.c
opts.c
opts.def

diff --git a/ftepp.c b/ftepp.c
index a2bbb684681893f27c68f00717ec0db16b8ed151..050d6d81b92f8f9f2f3a1b8371bd1da77b7d6d84 100644 (file)
--- 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 9aa8f633eff1c4ba2b901ae4d76b1d07fcee7a85..27d6a560473ead2f183a8adbeffc95c3fd470901 100644 (file)
--- 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);
index f4d01e631ea2c163fb8fd6f5223009728ed9b1ba..57625ddb3ce23bde3bbfde21b48e364971cd3bf1 100644 (file)
--- 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