Commit fcf830ab by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.

2016-08-19  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

libcpp/
	* expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.

testsuite/
	* gcc.dg/cpp/warn-undef.c: Append "evaluates to 0" to dg-error.
	* gcc.dg/cpp/warn-undef-2.c: Likewise.

From-SVN: r239609
parent 1f4ed04e
2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gcc.dg/cpp/warn-undef.c: Append "evaluates to 0" to dg-error.
* gcc.dg/cpp/warn-undef-2.c: Likewise.
2016-08-19 Richard Biener <rguenther@suse.de> 2016-08-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/77286 PR tree-optimization/77286
......
// { dg-do preprocess } // { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=undef" } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=undef" }
/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#if x // { dg-error "\"x\" is not defined .-Werror=undef." } #if x // { dg-error "\"x\" is not defined, evaluates to 0 .-Werror=undef." }
#endif #endif
// { dg-do preprocess } // { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wundef" } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Wundef" }
#if x // { dg-warning "\"x\" is not defined .-Wundef." } #if x // { dg-warning "\"x\" is not defined, evaluates to 0 .-Wundef." }
#endif #endif
2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2016-08-18 David Malcolm <dmalcolm@redhat.com> 2016-08-18 David Malcolm <dmalcolm@redhat.com>
* directives.c (directive_names): New array. * directives.c (directive_names): New array.
......
...@@ -1073,7 +1073,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token, ...@@ -1073,7 +1073,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token,
result.low = 0; result.low = 0;
if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval) if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval)
cpp_warning_with_line (pfile, CPP_W_UNDEF, virtual_location, 0, cpp_warning_with_line (pfile, CPP_W_UNDEF, virtual_location, 0,
"\"%s\" is not defined", "\"%s\" is not defined, evaluates to 0",
NODE_NAME (token->val.node.node)); NODE_NAME (token->val.node.node));
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment