[PATCH] Allow embedded timestamps by C/C++ macros to be set externally (2)

Dhole dhole@openmailbox.org
Thu Nov 19 15:40:00 GMT 2015


On 11/19/2015 04:35 PM, Dhole wrote:
> On 11/17/2015 12:26 AM, Joseph Myers wrote:
>> fprintf to stderr is never appropriate.  All diagnostics should go through 
>> a diagnostic function that properly causes the message to be translated.
>>
>> If you want a fatal error (exit immediately after giving the message 
>> rather than continuing compilation), use the fatal_error function, which 
>> takes an explicit location.  You can use UNKNOWN_LOCATION to avoid an 
>> input file being named, (...)
> 
> Thanks for the advise! I've applied the change in the patch.
> 
>> Also, this environment variable needs documenting in cppenv.texi.
> 
> I have added the documentation as required, it's included in the
> attached patch.
> 
> Regarding the copyright assignment process, it's in progress :)
> 
> 
> Best regards,
> Dhole
> 

Resending the ChangeLog as it was malformed.

-- 
Dhole
-------------- next part --------------
gcc/c-family/ChangeLog:

2015-11-18  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>
	* c-common.c (get_source_date_epoch): New function, gets the environment
	variable SOURCE_DATE_EPOCH and parses it as long long with error 
	handling.
	* c-common.h (get_source_date_epoch): Prototype.
	* c-lex.c (c_lex_with_flags): set parse_in->source_date_epoch.

gcc/ChangeLog:

2015-11-18  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>
	* doc/cppenv.texi: Document SOURCE_DATE_EPOCH environment variable.

libcpp/ChangeLog:

2015-11-18  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>
	* include/cpplib.h (cpp_init_source_date_epoch): Prototype.
	* init.c (cpp_init_source_date_epoch): New function.
	* internal.h: Added source_date_epoch variable to struct
	cpp_reader to store a reproducible date.
	* macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 
	pfile->source_date_epoch instead of localtime if source_date_epoch is 
	set, to be used for __DATE__ and __TIME__ macros to help reproducible 
	builds.


More information about the Gcc-patches mailing list