aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2016-09-06 14:44:22 +0200
committerYvan Roux <yvan.roux@linaro.org>2016-09-07 22:09:05 +0200
commit54cf94ae5fcb03be66f7a7140be76c4a777e9c8f (patch)
tree6b34bb055c6accc8cd245c59fa1f86a9100940fc
parentf648c88b12ab498c8a60fb16eaccbdeff68ce927 (diff)
gcc/testsuite/
Backport from trunk r239609. 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. libcpp/ Backport from trunk r239609. 2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic. Change-Id: I363be41700a632019b206fdda9b8d94a4a734432
-rw-r--r--gcc/testsuite/gcc.dg/cpp/warn-undef-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/warn-undef.c2
-rw-r--r--libcpp/expr.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c b/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
index 15fdde95c10..e71aebafcf0 100644
--- a/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
@@ -1,5 +1,5 @@
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=undef" }
/* { 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
diff --git a/gcc/testsuite/gcc.dg/cpp/warn-undef.c b/gcc/testsuite/gcc.dg/cpp/warn-undef.c
index dd4524d8136..2c2c4219e2e 100644
--- a/gcc/testsuite/gcc.dg/cpp/warn-undef.c
+++ b/gcc/testsuite/gcc.dg/cpp/warn-undef.c
@@ -1,5 +1,5 @@
// { dg-do preprocess }
// { 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
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 5cdca6f1bec..d32f5a97189 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -1073,7 +1073,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token,
result.low = 0;
if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval)
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));
}
break;