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

Re: Bug#876901: QFINDTESTDATA uses __FILE__



In data lunedì 13 novembre 2017 20:20:00 CET, Ximin Luo ha scritto:
> Pino Toscano:
> > [..]
> > 
> > A better approach here is to work on removing the invalid & abusing
> > usages of __FILE__ from packages, just like it was done for __DATE__.
> > 
> 
> We in fact did not do the latter because it was easier to implement
> SOURCE_DATE_EPOCH to fix the expansion of __DATE__, rather than patch
> 400 packages.

To be fair, it should be noted that various project stopped using it
altogether, as result of "reproducible builds" patches.

Also, __DATE__ expnds to a C string like "Nov 13 2017":
https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
this means that you cannot do something like "__DATE__ + 3" you
mentioned earlier, but that requires a bit more work to parse it...
and at that point using gmtime() & friends is then way easier.

Indeed, all the usages I have seen so far are just simple display of
the build time, with messages like
  "Foo App vX.Y built at " __DATE__ " " __TIME__
Hence, changing what __DATE__ returns is almost a no-op for the 99+%
of sources using it, since there is basically almost no other usage for
it.

OTOH, as already mentioned in other replies, __FILE__ is actually
*used* for stuff, it is not a mere display string.

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: