Re: [PATCH] __DATE__ & __TIME expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Damien Lespiau wrote:
> Makes __DATE__expand to a character string literal of
> the form "Mmm dd yyyy" where the names of the months
> are the same as those generated by the asctime function,
> and the first character of dd is a space character if the
> value is less than 10.
> Makes __TIME__ expand to a a character string literal of
> the form "hh:mm:ss" as in the time generated by the
> asctime function.

Thanks for this patch.  I think I'd prefer to avoid calling time more than
once per run of the program.  __DATE__ and __TIME__ seem sufficiently rare
(ideally at most once each per project anyway) that avoiding repeated calls to
strftime probably doesn't matter; however, avoiding repeated calls to time
seems useful, even if it only avoids the one extra call when you use __DATE__
and __TIME__ once each.

Could you make the time_t static and only call time once?

Thanks,
Josh Triplett

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux