re PR c/3190 (-Wformat-y2k doesn't belong to -Wall - it's hard to avoid)
authorJoseph Myers <jsm@polyomino.org.uk>
Sat, 8 Nov 2003 22:42:00 +0000 (22:42 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sat, 8 Nov 2003 22:42:00 +0000 (22:42 +0000)
PR c/3190
PR c/8714
* c-format.c (set_Wformat): Do not enable -Wformat-y2k by default.
* invoke.texi: Update.

testsuite:
PR c/3190
PR c/8714
* gcc.dg/format/c90-strftime-1.c, gcc.dg/format/c90-strftime-2.c,
gcc.dg/format/c99-strftime-1.c, gcc.dg/format/ext3.c,
gcc.dg/format/no-y2k-1.c: Update.

From-SVN: r73378

gcc/ChangeLog
gcc/c-format.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/c90-strftime-1.c
gcc/testsuite/gcc.dg/format/c90-strftime-2.c
gcc/testsuite/gcc.dg/format/c99-strftime-1.c
gcc/testsuite/gcc.dg/format/ext-3.c
gcc/testsuite/gcc.dg/format/no-y2k-1.c

index 60d79213f564acef7b4ea3e16f7e6a110cd098e0..d045a70d9cc1c47903fec9d0b641012ded49e07d 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-08  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       PR c/3190
+       PR c/8714
+       * c-format.c (set_Wformat): Do not enable -Wformat-y2k by default.
+       * invoke.texi: Update.
+
 2003-11-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR optimization/12630
index 82fb593f440fc78efb7eb6486eee1216ab126ddc..269be1795dbe30d1321fa6fbd766e2a6d481a439 100644 (file)
@@ -37,13 +37,13 @@ void
 set_Wformat (int setting)
 {
   warn_format = setting;
-  warn_format_y2k = setting;
   warn_format_extra_args = setting;
   warn_format_zero_length = setting;
   if (setting != 1)
     {
       warn_format_nonliteral = setting;
       warn_format_security = setting;
+      warn_format_y2k = setting;
     }
   /* Make sure not to disable -Wnonnull if -Wformat=0 is specified.  */
   if (setting)
index b430af6c71fc8bc3773f56f5cce53ffdc33d2fd7..a1c2d0b03f764c176b31a51e161b86305ded9ec2 100644 (file)
@@ -218,7 +218,7 @@ in the following sections.
 -Werror  -Werror-implicit-function-declaration @gol
 -Wfloat-equal  -Wformat  -Wformat=2 @gol
 -Wno-format-extra-args -Wformat-nonliteral @gol
--Wformat-security  -Wno-format-y2k @gol
+-Wformat-security  -Wformat-y2k @gol
 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
 -Wimport  -Wno-import  -Winit-self  -Winline @gol
 -Wno-invalid-offsetof  -Winvalid-pch @gol
@@ -2125,14 +2125,14 @@ Since @option{-Wformat} also checks for null format arguments for
 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
 
 @option{-Wformat} is included in @option{-Wall}.  For more control over some
-aspects of format checking, the options @option{-Wno-format-y2k},
+aspects of format checking, the options @option{-Wformat-y2k},
 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
 
-@item -Wno-format-y2k
-@opindex Wno-format-y2k
-If @option{-Wformat} is specified, do not warn about @code{strftime}
+@item -Wformat-y2k
+@opindex Wformat-y2k
+If @option{-Wformat} is specified, also warn about @code{strftime}
 formats which may yield only a two-digit year.
 
 @item -Wno-format-extra-args
@@ -2176,7 +2176,7 @@ included in @option{-Wformat-nonliteral}.)
 @opindex Wformat=2
 Enable @option{-Wformat} plus format checks not included in
 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
--Wformat-nonliteral -Wformat-security}.
+-Wformat-nonliteral -Wformat-security -Wformat-y2k}.
 
 @item -Wnonnull
 @opindex Wnonnull
index edc3de9ce85187395ff45613b5fc184865148aa6..587bfdd7b9e372ca88b23de49f3e1d9f89fd9ead 100644 (file)
@@ -1,3 +1,11 @@
+2003-11-08  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       PR c/3190
+       PR c/8714
+       * gcc.dg/format/c90-strftime-1.c, gcc.dg/format/c90-strftime-2.c,
+       gcc.dg/format/c99-strftime-1.c, gcc.dg/format/ext3.c,
+       gcc.dg/format/no-y2k-1.c: Update.
+
 2003-11-08  Roger Sayle  <roger@eyesopen.com>
 
        PR optimization/10467
index 0d75e9194dbd86277e0fba3b52c7ff2effa4e3be..1739f7b75eedbc78085379068f3cfda561a1fa6c 100644 (file)
@@ -1,7 +1,7 @@
 /* Test for strftime formats.  Formats using C90 features.  */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
 
 #include "format.h"
 
index 9742e44d055aada95c013b5aab798ff55026bd28..8b8398ed930d76d11f25815af811821dc7735a4a 100644 (file)
@@ -2,7 +2,7 @@
    pedantic C90 mode.  */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
 
 #include "format.h"
 
index a643d2999a6ea896f88295899a86c0b7f76fb9ed..1730738df42e19d91d5b1836f43707939cada760 100644 (file)
@@ -1,7 +1,7 @@
 /* Test for strftime formats.  Formats using C99 features.  */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wformat-y2k" } */
 
 #include "format.h"
 
index e71731ed987f81563c1ec970ad80efb1d3e21c54..937e11212f761aefdc3d6560f27f4b954d0e81bb 100644 (file)
@@ -3,7 +3,7 @@
 */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=gnu99 -Wformat" } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-y2k" } */
 
 #include "format.h"
 
index ee68cd6db9faa189e9796016c4f39a668fe31d51..4dfd5a04ebdff61d2fd16679535dbe87694389b3 100644 (file)
@@ -1,7 +1,7 @@
-/* Test for warnings for Y2K problems being disabled by -Wno-format-y2k.  */
+/* Test for warnings for Y2K problems not being on by default.  */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=gnu99 -Wformat -Wno-format-y2k" } */
+/* { dg-options "-std=gnu99 -Wformat" } */
 
 #include "format.h"