From: Dale Weiler Date: Fri, 21 Dec 2012 03:12:58 +0000 (+0000) Subject: added -Wcpp (for turning off cpp warnings defined with #warning like GCC/clang/pathsc... X-Git-Tag: 0.2~31 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f78ab9061b015f94e3925b48e3d856f1afc44880;p=xonotic%2Fgmqcc.git added -Wcpp (for turning off cpp warnings defined with #warning like GCC/clang/pathscale .. no more [-Wunused-variable]) --- diff --git a/ftepp.c b/ftepp.c index c7e4273..3235147 100644 --- a/ftepp.c +++ b/ftepp.c @@ -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) { diff --git a/opts.c b/opts.c index a8e3e6c..6008fb1 100644 --- a/opts.c +++ b/opts.c @@ -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); diff --git a/opts.def b/opts.def index 87aaf36..9e53ff5 100644 --- a/opts.def +++ b/opts.def @@ -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