This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow embedded timestamps by C/C++ macros to be set externally (3)
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Eduard Sanou <eduardsanou at openmailbox dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Dhole <dhole at openmailbox dot org>, Bernd Schmidt <bschmidt at redhat dot com>, Matthias Klose <doko at ubuntu dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 06 May 2016 08:26:07 +0200
- Subject: Re: Allow embedded timestamps by C/C++ macros to be set externally (3)
- Authentication-results: sourceware.org; auth=none
- References: <571FFADB dot 3080209 at redhat dot com> <20160427155633 dot GA21574 at panther> <5721D5DC dot 7060004 at ubuntu dot com> <20160428100815 dot GL26501 at tucnak dot zalov dot cz> <5721E68C dot 20208 at redhat dot com> <20160428103506 dot GM26501 at tucnak dot zalov dot cz> <57220BC2 dot 7080901 at redhat dot com> <20160428131420 dot GO26501 at tucnak dot zalov dot cz> <20160428182956 dot GG21574 at panther> <20160429071744 dot GX26501 at tucnak dot zalov dot cz> <20160505232654 dot GW21574 at panther>
Eduard Sanou <eduardsanou@openmailbox.org> writes:
> diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
> index 1714284..dea2900 100644
> --- a/gcc/c-family/c-common.h
> +++ b/gcc/c-family/c-common.h
> @@ -1086,6 +1086,16 @@ extern vec<tree, va_gc> *make_tree_vector_copy (const vec<tree, va_gc> *);
> c_register_builtin_type. */
> extern GTY(()) tree registered_builtin_types;
>
> +/* Read SOURCE_DATE_EPOCH from environment to have a deterministic
> + timestamp to replace embedded current dates to get reproducible
> + results. Returns -1 if SOURCE_DATE_EPOCH is not defined. */
> +extern time_t cb_get_source_date_epoch (cpp_reader *pfile);
> +
> +/* The value (as a unix timestamp) corresponds to date
> + "Dec 31 9999 23:59:59 UTC", which is the latest date that __DATE__ and
> + __TIME__ can store. */
> +#define MAX_SOURCE_DATE_EPOCH 253402300799
This is bigger than INT_MAX, doesn't it trigger a warning that breaks
bootstrap?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."