This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] __TIMESTAMP__ predefined macro
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: hjl at lucon dot org (H. J. Lu)
- Cc: grigory_zagorodnev at linux dot intel dot com (Grigory Zagorodnev), pinskia at physics dot uc dot edu (Andrew Pinski), gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Feb 2006 10:53:18 -0500 (EST)
- Subject: Re: [patch] __TIMESTAMP__ predefined macro
>
> On Wed, Feb 15, 2006 at 06:26:58PM +0300, Grigory Zagorodnev wrote:
> >
> > >Also why don't you just use ctime or asctime instead of spelling it out?
> > This is correct. Describing __DATE__ and __TIME__ predefined macro in
> > section 6.10.8, the C99 Standard refers asctime. Thus using
> > asctime(localtime()) seems to be suitable solution. However the original
> > idea was to follow existing cpplib approach for __DATE__ and __TIME__
> > string generation.
> >
>
> asctime is locale dependent. Grigory's approach is locale independent,
> like __DATE__ and __TIME__.
No, asctime is locale independent.
-- pinski