From mboxrd@z Thu Jan 1 00:00:00 1970 From: proski@gnu.org To: gcc-gnats@gcc.gnu.org Subject: c/3190: -Wformat-y2k doesn't belong to -Wall - it's hard to avoid Date: Thu, 14 Jun 2001 22:56:00 -0000 Message-id: <20010615055520.27707.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00657.html List-Id: >Number: 3190 >Category: c >Synopsis: -Wformat-y2k doesn't belong to -Wall - it's hard to avoid >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Jun 14 22:56:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: proski@gnu.org >Release: gcc-3_0-branch CVS >Organization: >Environment: RedHat Linux 7.1, i586 (K6-2) >Description: -Wall assumes -Wformat which in turn includes -Wformat-y2k invoke.texi says: -Wall ... enables all the warnings ... that are easy to avoid (or modify to prevent the warning) The warning is: `%c' yields only last 2 digits of year in some locales No method is suggested to avoid the warning. I really want to use what the user prefers by setting locale. It's a user visible string. I fail to see how this is "easy to avoid" without sacrificing some functionality. >How-To-Repeat: $ cat >test.c < test.c:4: warning: `%c' yields only last 2 digits of year in some locales >Fix: (Very incomplete!!! Documentation should be changed in several places) --- c-format.c +++ c-format.c @@ -59,12 +59,12 @@ set_Wformat (setting) int setting; { warn_format = setting; - warn_format_y2k = setting; warn_format_extra_args = setting; if (setting != 1) { warn_format_nonliteral = setting; warn_format_security = setting; + warn_format_y2k = setting; } } >Release-Note: >Audit-Trail: >Unformatted: