Re: [Patch: libcpp, c-family, Fortran] Re: Warning about __DATE__ and __TIME__

2013-11-06 Thread Ian Lance Taylor
On Wed, Nov 6, 2013 at 7:37 AM, Tom Tromey wrote: >> "Tobias" == Tobias Burnus writes: > > Tobias> + cpp_warning (pfile, CPP_W_DATE_TIME, "Macro \"%s\" might > prevent " > Tobias> + "reproduce builds", NODE_NAME (node)); > > Tobias> + cpp_warning (pfile, CP

Re: [Patch: libcpp, c-family, Fortran] Re: Warning about __DATE__ and __TIME__

2013-11-06 Thread Tom Tromey
> "Tobias" == Tobias Burnus writes: Tobias> Updated version attached – after bootstrapping and regtesting on Tobias> x86-64-gnu-linux Tobias> OK? Sorry, I didn't notice this until today. Tobias> @@ -925,7 +928,8 @@ enum { Tobias>CPP_W_NORMALIZE, Tobias>CPP_W_INVALID_PCH, Tobias>

Re: [Patch: libcpp, c-family, Fortran] Re: Warning about __DATE__ and __TIME__

2013-11-05 Thread Steve Kargl
On Mon, Nov 04, 2013 at 09:58:30PM +0100, Tobias Burnus wrote: > Tobias Burnus wrote: > > Gerald Pfeifer 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 _

Re: Warning about __DATE__ and __TIME__

2013-11-04 Thread Jonathan Wakely
On 4 November 2013 22:26, Andreas Schwab wrote: > >> The undefined behaviour study group of the C++ committee are >> considering making it ill-formed, which would require a diagnostic. > > That still wouldn't cover command line arguments. Ah yes, as it would still be predefined, but to the value g

Re: [Patch: libcpp, c-family, Fortran] Re: Warning about __DATE__ and __TIME__

2013-11-04 Thread Joseph S. Myers
The warning should say "macro" not "Macro" and I think "reproducing" not "reproduce". The c-family and libcpp changes are OK with that fixed. -- Joseph S. Myers jos...@codesourcery.com

Re: Warning about __DATE__ and __TIME__

2013-11-04 Thread Gerald Pfeifer
On Mon, 4 Nov 2013, Jonathan Wakely wrote: > On 28 October 2013 21:13, Ian Lance Taylor wrote: >> 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' > It's undefined behaviour in both C and C++ to redefine pre-defined > macro

Re: Warning about __DATE__ and __TIME__

2013-11-04 Thread Jonathan Wakely
On 28 October 2013 21:13, Ian Lance Taylor wrote: > On Sun, Oct 27, 2013 at 12:04 PM, Gerald Pfeifer 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__.

[Patch: libcpp, c-family, Fortran] Re: Warning about __DATE__ and __TIME__

2013-11-04 Thread Tobias Burnus
Tobias Burnus wrote: Gerald Pfeifer 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__. I assume that he also likes to have a warning for __TIMESTAMP__. I w

Re: Warning about __DATE__ and __TIME__

2013-10-28 Thread Ian Lance Taylor
On Sun, Oct 27, 2013 at 12:04 PM, Gerald Pfeifer 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 o

Re: Warning about __DATE__ and __TIME__

2013-10-28 Thread Joseph S. Myers
On Mon, 28 Oct 2013, Frank Ch. Eigler wrote: > Gerald Pfeifer writes: > > > 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__. [...] > > How about instead

Re: Warning about __DATE__ and __TIME__

2013-10-28 Thread Jakub Jelinek
On Mon, Oct 28, 2013 at 09:10:08AM -0400, Frank Ch. Eigler wrote: > Gerald Pfeifer writes: > > > 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__. [...] >

Re: Warning about __DATE__ and __TIME__

2013-10-28 Thread Joseph S. Myers
On Sun, 27 Oct 2013, Gerald Pfeifer wrote: > In addition to Andreas' comments, can you please make this "@code{__TIME__}, > @code{__DATE__}, or @code{__TIMESTAP__}" > and then also send to gcc-patches@ TIMESTAMP, not TIMESTAP. -- Joseph S. Myers jos...@codesourcery.com

Re: Warning about __DATE__ and __TIME__

2013-10-28 Thread Frank Ch. Eigler
Gerald Pfeifer writes: > 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__. [...] How about instead adding a --time=X option to gcc (cpp?) instead, so that

Re: Warning about __DATE__ and __TIME__

2013-10-27 Thread FX
> as soon as a program uses __DATE__ or __TIME__ at least once, builds of the > program will differ for that reason alone. Indeed. But I don’t really see the point of a warning: it’s not the sort of feature you use and then accidentaly discover that they have unintended side-effect; it’s actual

Re: Warning about __DATE__ and __TIME__

2013-10-27 Thread Gerald Pfeifer
On Sun, 27 Oct 2013, Tobias Burnus wrote: I assume that he also likes to have a warning for __TIMESTAMP__. So do I, but I asked to be sure. Do you mean something like the attached patch? (Only lightly tested.) Yep! Thanks. +@item -Wdate-time +@opindex Wdate-time +@opindex Wno-date-time

Re: Warning about __DATE__ and __TIME__

2013-10-27 Thread Andreas Schwab
Tobias Burnus writes: > diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt > index 22f8939..f765018 100644 > --- a/gcc/c-family/c.opt > +++ b/gcc/c-family/c.opt > @@ -640,6 +640,10 @@ Wpragmas > C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning > Warn about misuses of pragmas > > +Wdate-t

Re: Warning about __DATE__ and __TIME__

2013-10-27 Thread Tobias Burnus
Gerald Pfeifer 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__. I assume that he also likes to have a warning for __TIMESTAMP__. I was thinking a new warn