https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71183

--- Comment #6 from James Clarke <jrtc27 at jrtc27 dot com> ---
This approach is still fundamentally flawed; SOURCE_DATE_EPOCH is still not
honoured when preprocessing:

$ echo 'int main() { puts(__DATE__); }' | SOURCE_DATE_EPOCH=86400 gcc -x c -
<stdin>: In function ‘main’:
<stdin>:1:14: warning: implicit declaration of function ‘puts’
[-Wimplicit-function-declaration]
$ ./a.out
Jan  2 1970
$ echo 'int main() { puts(__DATE__); }' | SOURCE_DATE_EPOCH=86400 gcc -E - 
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
int main() { puts("Jun 12 2016"); }

I guess I should file another bug report for this?

Reply via email to