This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: `%y' yields only last 2 digits of year
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: schwab at suse dot de, clock at atrey dot karlin dot mff dot cuni dot cz, fw at deneb dot enyo dot de, gcc at gcc dot gnu dot org
- Date: Wed, 13 Mar 2002 15:58:10 +0100
- Subject: Re: warning: `%y' yields only last 2 digits of year
- References: <20020313145039.45726F2F02@nile.gnat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Mar 13, 2002 at 09:50:39AM -0500, Robert Dewar wrote:
> It was *specifically* for that common technique that I gave my example, and
> the suggestion of using %Y is irrelevant.
>
> Once again, please don't assume you know better than the applications
> programmer what the *applications* requirements are. Warnings in languages
> should be about supposing that you know enough about the *language* in
> which the application is being written to identify constructs that are
> suspicious at the language level.
But if you write 19%y or 20%y, then the probability that this is
an application bug is way higher than that this is something intentional.
So IMHO the warning should be triggered only if %y is preceeded by 19 or
20.
Jakub