From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18056 invoked by alias); 12 Mar 2002 22:56:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17998 invoked by uid 71); 12 Mar 2002 22:56:06 -0000 Date: Tue, 12 Mar 2002 14:56:00 -0000 Message-ID: <20020312225606.17992.qmail@sources.redhat.com> To: jsm28@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year Reply-To: "Joseph S. Myers" X-SW-Source: 2002-03/txt/msg00404.txt.bz2 List-Id: The following reply was made to PR c/3190; it has been noted by GNATS. From: "Joseph S. Myers" To: Robert Dewar Cc: , , , 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