From 300d03a832893ebdad049707f79f9273701bbf26 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Sat, 14 Mar 2009 17:55:16 +0000 Subject: [PATCH] Switch over to gnu99 compilation on default for userland. Tested by: make universe Tested by: ports exp build (done by pav) Reviewed by: ru Reviewed by: silence on arch Approved by: ed (mentor) --- cddl/Makefile.inc | 2 ++ cddl/lib/libzpool/Makefile | 4 ++-- cddl/usr.bin/ztest/Makefile | 4 ++-- cddl/usr.sbin/zdb/Makefile | 4 ++-- share/mk/bsd.sys.mk | 17 +++++++++-------- tools/regression/include/tgmath/Makefile | 3 ++- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index 99ef3331014c..4161c27a2ad6 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +CSTD?= gnu89 diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 26d54993d1de..54ab6c01b2ae 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -33,8 +33,6 @@ SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} \ ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \ ${UNICODE_SRCS} -CFLAGS+= -std=c99 - CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem @@ -60,4 +58,6 @@ LDADD= -lpthread -lz # atomic.S doesn't like profiling. NO_PROFILE= +CSTD= c99 + .include diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile index cc0bca4747f0..67ade45ad021 100644 --- a/cddl/usr.bin/ztest/Makefile +++ b/cddl/usr.bin/ztest/Makefile @@ -5,8 +5,6 @@ PROG= ztest NO_MAN= -CFLAGS+= -std=c99 - CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem @@ -21,4 +19,6 @@ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ ${LIBPTHREAD} ${LIBZ} ${LIBAVL} LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl +CSTD= c99 + .include diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile index f0c1b225c952..35ad2a141d2a 100644 --- a/cddl/usr.sbin/zdb/Makefile +++ b/cddl/usr.sbin/zdb/Makefile @@ -6,8 +6,6 @@ PROG= zdb MAN= zdb.8 SRCS= zdb.c zdb_il.c -CFLAGS+= -std=c99 - CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem @@ -25,4 +23,6 @@ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ ${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL} LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool +CSTD= c99 + .include diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 197c1d670596..34e04f8cf267 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -8,22 +8,23 @@ # for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143 +# the default is gnu99 for now +CSTD ?= gnu99 + .if !defined(NO_WARNS) && ${CC} != "icc" -. if defined(CSTD) -. if ${CSTD} == "k&r" +. if ${CSTD} == "k&r" CFLAGS += -traditional -. elif ${CSTD} == "c89" || ${CSTD} == "c90" +. elif ${CSTD} == "c89" || ${CSTD} == "c90" CFLAGS += -std=iso9899:1990 -. elif ${CSTD} == "c94" || ${CSTD} == "c95" +. elif ${CSTD} == "c94" || ${CSTD} == "c95" CFLAGS += -std=iso9899:199409 -. elif ${CSTD} == "c99" +. elif ${CSTD} == "c99" CFLAGS += -std=iso9899:1999 -. else +. else CFLAGS += -std=${CSTD} -. endif +. endif # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS += -pedantic -. endif . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers diff --git a/tools/regression/include/tgmath/Makefile b/tools/regression/include/tgmath/Makefile index 64626c51d3c2..53e3b9a36a1b 100644 --- a/tools/regression/include/tgmath/Makefile +++ b/tools/regression/include/tgmath/Makefile @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= tgmath -CFLAGS+= -fno-builtin -std=c99 +CSTD= c99 +CFLAGS+= -fno-builtin NO_MAN= .include