Skip to content

Commit 23c4e60

Browse files
committed
build: use "-std=gnu11" as compiler flags and depend on gcc's C11
So far, we didn't specify "-std" option, and it was ill defined which C behavior we require. Note that we already use __attribute__((__cleanup__(fcn))), so effectively we require either gcc or clang. A standard C compiler won't suffice. That is for good reasons, because features like the cleanup attribute are IMO invaluable and we should not write "C" without it. Also, it's 2024. It's basically impossilbe that you use gcc/clang with a version that doesn't yet support (gcc's) C11 variant. So explicitly require that via the "-std=gnu11" option. I don't think we currently require newer C features, so this is sufficient for us and for now.
1 parent 8961887 commit 23c4e60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pkgconfig_DATA = \
3232
libnl-xfrm-3.0.pc \
3333
$(NULL)
3434

35+
extra_cppflags = \
36+
-std=gnu11 \
37+
$(NULL)
38+
3539
warn_cppflags = \
3640
-Wall \
3741
-Wextra \
@@ -394,6 +398,7 @@ default_includes = \
394398
$(NULL)
395399

396400
default_cppflags = \
401+
$(extra_cppflags) \
397402
$(warn_cppflags) \
398403
$(defines_cppflags) \
399404
$(default_includes) \

0 commit comments

Comments
 (0)