summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.sys.mk
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2006-08-11 17:28:59 +0000
committerdes <des@FreeBSD.org>2006-08-11 17:28:59 +0000
commitbe4056d8d76d9a93b882980d9868de0fe07a1569 (patch)
tree31b2467ca36629779d3c79d0e774941fcd8bac84 /share/mk/bsd.sys.mk
parentb787cad1e08d4ef8d2fdcf4563a74659527e0c38 (diff)
downloadFreeBSD-src-be4056d8d76d9a93b882980d9868de0fe07a1569.zip
FreeBSD-src-be4056d8d76d9a93b882980d9868de0fe07a1569.tar.gz
Reintroduce CSTD, which allows a Makefile to specify the precise dialect
of C in which the program or library is written. Note that this is *not* intended to be used across the whole tree. It is intended to be used for individual libraries or programs which use specific language features which the compiler must know about in order to produce correct warnings at high WARNS levels. MFC after: 1 month
Diffstat (limited to 'share/mk/bsd.sys.mk')
-rw-r--r--share/mk/bsd.sys.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 5c840cd..bf5d8d9 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -9,6 +9,21 @@
# for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143
.if !defined(NO_WARNS) && ${CC} != "icc"
+. if defined(CSTD)
+. if ${CSTD} == "k&r"
+CFLAGS += -traditional
+. elif ${CSTD} == "c89" || ${CSTD} == "c90"
+CFLAGS += -std=iso9899:1990
+. elif ${CSTD} == "c94" || ${CSTD} == "c95"
+CFLAGS += -std=iso9899:199409
+. elif ${CSTD} == "c99"
+CFLAGS += -std=iso9899:1999
+. else
+CFLAGS += -std=${CSTD}
+. endif
+# -pedantic is problematic because it also imposes namespace restrictions
+#CFLAGS += -pedantic
+. endif
. if defined(WARNS)
. if ${WARNS} >= 1
CWARNFLAGS += -Wsystem-headers
OpenPOWER on IntegriCloud