You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #17880: build: add -Wdate-time to Werror flags
b0a2540 build: add Wdate-time to Werror flags (fanquake)
Pull request description:
`-Wdate-time`
Warn when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered as
they might prevent bit-wise-identical reproducible compilations.
This is supported by [GCC](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html) and [Clang](https://clang.llvm.org/docs/DiagnosticsReference.html#wdate-time).
Example output:
```bash
CXX bitcoind-bitcoind.o
bitcoind.cpp:48:20: warning: expansion of date or time macro is not reproducible [-Wdate-time]
printf("%s\n", __TIMESTAMP__);
^
bitcoind.cpp:49:20: warning: expansion of date or time macro is not reproducible [-Wdate-time]
printf("%s\n", __TIME__);
^
bitcoind.cpp:50:20: warning: expansion of date or time macro is not reproducible [-Wdate-time]
printf("%s\n", __DATE__);
^
3 warnings generated.
```
ACKs for top commit:
practicalswift:
ACK b0a2540 -- diff looks correct and guarding against potential non-reproducibility is good :)
promag:
Tested ACK b0a2540 on macos with clang. Already had `--enable-werror`, added a wild `printf("%s\n", __TIMESTAMP__)` and got the following error:
laanwj:
ACK b0a2540
hebasto:
ACK b0a2540
Tree-SHA512: b3a0b426e06dcd0c0baa94118c31158760b9690a8d0a15b5a2d544cb0879522e02817e134ef7346c707de09719818fc7e4bad1b3ad6b2dfe5e3c4169cdf5cb0d
0 commit comments