public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
@ 2002-03-12 14:56 Joe Buck
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Buck @ 2002-03-12 14:56 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/3190; it has been noted by GNATS.

From: Joe Buck <Joe.Buck@synopsys.com>
To: jsm28@cam.ac.uk (Joseph S. Myers)
Cc: dewar@gnat.com (Robert Dewar), clock@atrey.karlin.mff.cuni.cz,
	geoffk@geoffk.org, gcc@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 14:50:41 -0800 (PST)

 > It's a style warning, as with many other GCC warnings.  It's of use if you
 > consider that wanting to output 2-digit years is unusual and a bad idea.
 
 Such things clearly don't belong in -Wall, especially since there are
 situations where a two-digit year is required by the specification.
 
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
@ 2002-03-12 15:16 Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2002-03-12 15:16 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/3190; it has been noted by GNATS.

From: dewar@gnat.com (Robert Dewar)
To: dewar@gnat.com, jsm28@cam.ac.uk
Cc: clock@atrey.karlin.mff.cuni.cz, gcc-gnats@gcc.gnu.org,
	gcc@gcc.gnu.org, geoffk@geoffk.org
Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 18:06:33 -0500 (EST)

 <<That date has six possible interpretations (the order of preference
 between them being culturally dependent).  Unless you have some
 arrangement as to the interpretation of such dates with anyone who might
 read them, they hardly seem like a good idea to write - certainly, when
 such dates appear on web pages, they generally are confusing and it's a
 matter of second-guessing the intent of the writer.  I'd always use
 yyyy-mm-dd (ISO 8601 format) in such a case, given a free-format date
 field.
 >>
 
 Wait a moment, you are obfuscating with irrelevancy here :-)
 
 I *specifically* talked about the date on a check (and given the spelling,
 I had in mind a US check, and not a british cheque). The interpretation
 of the date is quite unambiguous here, and I definitely do NOT suggest
 thgat you try to use the ISO format in that context.
 
 Actually I prefer in more general contexts to write something like 
 Mar 16 '02 which is clear to all (of course in those very rare contexts
 where the century is not clear from context it is OK to use 2002).
 
 But all this irrelevant discussion has nothing to do with the warning. 
 %y is a perfectly well defined, and useful function. it is reasonable
 to assume that anyone using this function knows what it does and means
 to use it.
 
 By the way, I have often filled out goverment forms that allowed precisely
 two digits for the year :-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
@ 2002-03-12 14:56 Joseph S. Myers
  0 siblings, 0 replies; 5+ messages in thread
From: Joseph S. Myers @ 2002-03-12 14:56 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/3190; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Robert Dewar <dewar@gnat.com>
Cc: <clock@atrey.karlin.mff.cuni.cz>,  <gcc-gnats@gcc.gnu.org>, 
     <gcc@gcc.gnu.org>,  <geoffk@geoffk.org>
Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 22:54:51 +0000 (GMT)

 On Tue, 12 Mar 2002, Robert Dewar wrote:
 
 > But there are lots of forms which *require* the year to be output as two
 > digits, and there is nothing wrong at all with doing so. To think otherwise
 > is to have taken some totally bizarre viewpoint of what Y2K was all about.
 
 There are probably many bad programs that concatenate "19" with the result
 of %y.  Cases where a 2-digit year is externally specified, and you *know*
 that this will work properly across the Y2.1K transition[1], would seem
 quite specialised.
 
 > It's perfectly fine for example to say 01/05/02 on a check, and requiring
 > 2002 is a waste of ink. I don't see any *language* style issue and that
 
 That date has six possible interpretations (the order of preference
 between them being culturally dependent).  Unless you have some
 arrangement as to the interpretation of such dates with anyone who might
 read them, they hardly seem like a good idea to write - certainly, when
 such dates appear on web pages, they generally are confusing and it's a
 matter of second-guessing the intent of the writer.  I'd always use
 yyyy-mm-dd (ISO 8601 format) in such a case, given a free-format date
 field.
 
 > is all that style warnings should be about. This is about *what* you
 > are programming, whereas style options should be about *how* you are
 > programming. 
 
 It's about how you are using a particular ISO C standard interface.
 
 > An anology would be if the compiler watched for the string "Mrs." in output
 > and printed a warning saying "inappropriate term, consider using Ms instead".
 
 Given some past linux-kernel discussions, I suspect a few people might
 find useful a warning option that checked for some substrings in the
 arguments to certain functions and warned about them.
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
@ 2002-03-12 14:46 Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2002-03-12 14:46 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/3190; it has been noted by GNATS.

From: dewar@gnat.com (Robert Dewar)
To: dewar@gnat.com, jsm28@cam.ac.uk
Cc: clock@atrey.karlin.mff.cuni.cz, gcc-gnats@gcc.gnu.org,
	gcc@gcc.gnu.org, geoffk@geoffk.org
Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 17:36:04 -0500 (EST)

 But there are lots of forms which *require* the year to be output as two
 digits, and there is nothing wrong at all with doing so. To think otherwise
 is to have taken some totally bizarre viewpoint of what Y2K was all about.
 
 It's perfectly fine for example to say 01/05/02 on a check, and requiring
 2002 is a waste of ink. I don't see any *language* style issue and that
 is all that style warnings should be about. This is about *what* you
 are programming, whereas style options should be about *how* you are
 programming. 
 
 An anology would be if the compiler watched for the string "Mrs." in output
 and printed a warning saying "inappropriate term, consider using Ms instead".


^ permalink raw reply	[flat|nested] 5+ messages in thread

* c/3190 Re: warning: `%y' yields only last 2 digits of year
@ 2002-03-12 14:16 Joseph S. Myers
  0 siblings, 0 replies; 5+ messages in thread
From: Joseph S. Myers @ 2002-03-12 14:16 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/3190; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Robert Dewar <dewar@gnat.com>
Cc: <clock@atrey.karlin.mff.cuni.cz>,  <geoffk@geoffk.org>, 
     <gcc@gcc.gnu.org>,  <gcc-gnats@gcc.gnu.org>
Subject: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 22:11:58 +0000 (GMT)

 On Tue, 12 Mar 2002, Robert Dewar wrote:
 
 > What a silly warning, and what an even sillier option. I sure agree with
 > Karel on this one, to whom could such a warning possibly be useful?
 
 It's a style warning, as with many other GCC warnings.  It's of use if you
 consider that wanting to output 2-digit years is unusual and a bad idea.
 Of course they *can* be used safely, just as gets() can be used safely if
 you know exactly what input can be passed to the program, but that's
 unusual.
 
 The question of whether such warnings (and which such warnings) should be
 in -Wall is c/3190.  In the reply to that PR I reqested feedback
 (especially from NetBSD's GCC maintainers) on which of the separate cases
 involved should be warned about when, but the PR hasn't yet received any.
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-03-12 23:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-12 14:56 c/3190 Re: warning: `%y' yields only last 2 digits of year Joe Buck
  -- strict thread matches above, loose matches on Subject: below --
2002-03-12 15:16 Robert Dewar
2002-03-12 14:56 Joseph S. Myers
2002-03-12 14:46 Robert Dewar
2002-03-12 14:16 Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).