expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Fri, 19 Aug 2016 13:17:09 +0000 (13:17 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Fri, 19 Aug 2016 13:17:09 +0000 (13:17 +0000)
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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
gcc/testsuite/gcc.dg/cpp/warn-undef.c
libcpp/ChangeLog
libcpp/expr.c

index 4567c7e1f4619b7b24c6c1e8b6fe327afe8b0c04..6590fab9c290cce0fdbaee7359af053e515243a2 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        PR tree-optimization/77286
index 15fdde95c10fb9313e9b7ae96fb0ea5b4c4d4136..e71aebafcf09078d71be45e8208ad5759918ba2a 100644 (file)
@@ -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
index dd4524d8136e4e297c14c6c177f7835663edff1e..2c2c4219e2eba80837c95564540751ba94c7f8b5 100644 (file)
@@ -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
index 5d4a09450e0fe55b1718c9cb314fdb40383b1b8f..e8e43f7285b5d5f042bb784fdfa929f246e4604f 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        * directives.c (directive_names): New array.
index 5cdca6f1bec6453cfd494fc4d8b39ed207246714..d32f5a971899ee15626119515552ac171fb91742 100644 (file)
@@ -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;