Enable -Wdate-time warning

This produces an "expansion of date or time macro is not reproducible"
warning or error upon use of __DATE__ or __TIME__.

Provide NO_WDATE_TIME for ports or 3rd party software to opt out.

This is a recommit of 489d7a8528, which was reverted (by baf8cbcd97)
due to ports build failures.

PR:		267902 [exp-run]
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29580
This commit is contained in:
Ed Maste 2022-02-09 17:10:03 -05:00
parent 983a18021d
commit a8f92d247e

View File

@ -75,6 +75,9 @@ CWARNFLAGS.clang+= -Wthread-safety
CWARNFLAGS+= -Wno-uninitialized
.endif # WARNS >=2 && WARNS <= 4
CWARNFLAGS+= -Wno-pointer-sign
.if !defined(NO_WDATE_TIME)
CWARNFLAGS+= -Wdate-time
.endif # NO_WDATE_TIME
# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
# is set to low values, these have to be disabled explicitly.
.if ${WARNS} <= 6