Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: How to fix warning: [-Wdate-time] Date: Sat, 15 Apr 2017 15:05:37 -0700 Organization: None to speak of Lines: 28 Message-ID: References: <49quec1a81m1hnbja9vqcj12j2appsmm2n@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="da8d94982bea82fb3f3cc3c0e5345c5b"; logging-data="5707"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VtxFBPBntGqL9n2U8mf4D" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:O0LHWEfCYO/nDARC3F/8WkYQ1f0= sha1:8cnlW8+lEEwWxk63hxwajIrXRH4= Xref: csiph.com comp.lang.c:108165 Mehdi Amini writes: > On 04/14/2017 08:20 PM, Keith Thompson wrote: [...] >> Why can't you just invoke the compiler without the "-Wdate-time" option, >> or with "-Wno-date-time"? > > IMHO this warning exists for a reason, so I just disable it for this > part only. Of course it exists for a reason, but why assume that that reason applies to you? If you need bitwise identical output from your compiler, then the -Wdate-time option is one way to enforce that -- but if you're using __DATE__ and __TIME__ in your code, then you obviously *don't* need bitwise identical output. Why on Earth would you use a compile-time option that enforces something you don't need -- and then use an compiler-specific macro to override it? The __DATE__ and __TIME__ macros also exist for a reason. If you had a reason to use -Wdate-time for most of your code, then using the #pragma would make sense, but based on what you've said that doesn't seem to be the case. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"