toplev.c (general_init): Set default for fdiagnostics-show-option.
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 23 Apr 2010 17:14:27 +0000 (17:14 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 23 Apr 2010 17:14:27 +0000 (17:14 +0000)
2010-04-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

* toplev.c (general_init): Set default for
fdiagnostics-show-option.
* opts.c (common_handle_option): Allow disabling it.
* common.opt (fdiagnostics-show-option): Add Var. Enabled by
default.
testsuite/
* gcc.dg/Wconversion-integer.c: Update.

From-SVN: r158676

gcc/ChangeLog
gcc/common.opt
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wconversion-integer.c
gcc/toplev.c

index 6b5feae200f00879c39a9bca748e399e172b3904..2ec92ea6583e91da2edebb5aa4ef8be7bd242b96 100644 (file)
@@ -1,3 +1,11 @@
+2010-04-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * toplev.c (general_init): Set default for
+       fdiagnostics-show-option.
+       * opts.c (common_handle_option): Allow disabling it.
+       * common.opt (fdiagnostics-show-option): Add Var. Enabled by
+       default.
+       
 2010-04-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Only use conversion
index 6e9e6965f2220ca38e7966d7be1ed036b0251a3c..70b2c9050bfb1a3e2aa013b7442b3b4438e14d75 100644 (file)
@@ -465,7 +465,7 @@ Common Joined RejectNegative
 -fdiagnostics-show-location=[once|every-line]  How often to emit source location at the beginning of line-wrapped diagnostics
 
 fdiagnostics-show-option
-Common
+Common Var(flag_diagnostics_show_option) Init(1)
 Amend appropriate diagnostic messages with the command line option that controls them
 
 fdump-
index ce45e1cb0d5d69f2a6da75d95dbfb8e6c13467a7..0009a749daee1ec6180ed52c17e800b0ff0c04e2 100644 (file)
@@ -1766,7 +1766,7 @@ common_handle_option (size_t scode, const char *arg, int value,
       break;
 
     case OPT_fdiagnostics_show_option:
-      global_dc->show_option_requested = true;
+      global_dc->show_option_requested = value;
       break;
 
     case OPT_fdump_:
index fc5f35f58a0b425681827d7ce5bae6a5b2c31740..6e32296a3a9cf2d9b70dc17d485095aa7410143c 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * gcc.dg/Wconversion-integer.c: Update.
+
 2010-04-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/unchecked_convert5.adb: New test.
index b2101076f9383de72883b68d988b429b807a2a69..d50b155699b634f991cffd5e171e0583d2049e2a 100644 (file)
@@ -40,9 +40,9 @@ void h (int x)
   fuc ('A');
   uc = 'A';
 
-  uc = x ? 1U : -1; /* { dg-warning "conversion" } */
+  uc = x ? 1U : -1; /* { dg-warning " conversion" } */
   /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */
-  uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
+  uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" } */
   /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */
   uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
   uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
index 996bd900e65a6b9b3d55e83bebba08dafeb2d325..0dce6ee8e43f7d782c211dea0731c3b07371d463 100644 (file)
@@ -1694,6 +1694,7 @@ general_init (const char *argv0)
   /* Set a default printer.  Language specific initializations will
      override it later.  */
   pp_format_decoder (global_dc->printer) = &default_tree_printer;
+  global_dc->show_option_requested = flag_diagnostics_show_option;
 
   /* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages.  */
 #ifdef SIGSEGV