Message ID | 1437448995-7936-6-git-send-email-joel@jms.id.au |
---|---|
State | Accepted |
Headers | show |
Joel Stanley <joel@jms.id.au> writes: > We do not set a C version level, leaving it to the compiler to enforce > whatever it saw fit. > > We require GCC 4.8 or above, which supports C11, and GCC 5.2 and clang > 3.7 default to this version of the standard, so set it as the default. I switched it to do the "detect if it's supported" thing that I introduced yesterday, so we'll work out for HOSTCC and CC if it's supported and pass down if so. Some people have crazy old compilers, and I'll happily rant about that, but only with suitable beer supply, which, prior to my afternoon run, I should not avail myself of :)
diff --git a/Makefile.main b/Makefile.main index 3851c20..eeba745 100644 --- a/Makefile.main +++ b/Makefile.main @@ -51,7 +51,7 @@ CPPFLAGS += -DBITS_PER_LONG=64 -DHAVE_BIG_ENDIAN CPPFLAGS += -ffreestanding CFLAGS := -fno-strict-aliasing -fstack-protector-all -pie -mbig-endian -m64 -CFLAGS += -Wl,--oformat,elf64-powerpc +CFLAGS += -Wl,--oformat,elf64-powerpc -std=gnu11 ifeq ($(SKIBOOT_GCOV),1) CFLAGS += -fprofile-arcs -ftest-coverage -DSKIBOOT_GCOV=1
We do not set a C version level, leaving it to the compiler to enforce whatever it saw fit. We require GCC 4.8 or above, which supports C11, and GCC 5.2 and clang 3.7 default to this version of the standard, so set it as the default. Signed-off-by: Joel Stanley <joel@jms.id.au> --- Makefile.main | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)