This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning about __DATE__ and __TIME__
- From: Ian Lance Taylor <iant at google dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 28 Oct 2013 14:13:35 -0700
- Subject: Re: Warning about __DATE__ and __TIME__
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 00 dot 1310271959580 dot 1528 at trevally dot site>
On Sun, Oct 27, 2013 at 12:04 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> To make it easier to reproduce builds of software and entire GNU/Linux
> distributions, RMS had the idea of adding a warning to GCC that warns
> about the use of __DATE__ and __TIME__.
>
> Short of "interesting" changes to the environment or #defining these
> two, as soon as a program uses __DATE__ or __TIME__ at least once,
> builds of the program will differ for that reason alone. (There are
> others, but one step at a time; this is not the point of this mail).
>
> I was thinking a new warning -Wdate-time or similar could address
> this.
I don't have any strong objection, but I'll note that it's even easier
to use -D options.
CC='gcc -D__DATE__=today'
Ian