Hey!

I'm the original author of the SOURCE_DATE_EPOCH patch.

I've just seen this.  I believe that this bug was fixed in the the
rework of the patch I sent some days ago [1], although the latest
version of that patch has not been reviewed yet.  In [1] the
initialization of source_date_epoch is done at init.c
(cpp_create_reader), so now it should be initialized properly even when
just calling the preprocessor.  I tested your example and it gives the
expected output.

Although thinking further, maybe it would be more wise to use "0" as a
default value, to mean "not yet set", so that errors like this are
avoided.  So source_date_epoch could be:
0: not yet set
negative: disabled
positive: use this value as SOURCE_DATE_EPOCH

In such case, SOURCE_DATE_EPOCH would need to be a positive number
instead of a non-negative number.

In my latest patch it's:
-2: no yet set
-1: disabled
non-negative: use use this value SOURCE_DATE_EPOCH


[1] https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01026.html

Cheers,
-- 
Dhole

Attachment: signature.asc
Description: PGP signature

Reply via email to