Skip to content

Commit

Permalink
build: use "-std=gnu++11" as compiler flags
Browse files Browse the repository at this point in the history
So far, we didn't specify "-std" option, and it was ill defined which C
behavior we get.

Note that we already use __attribute__((__cleanup__(fcn))), so
effectively we require either gcc or clang. A standard C compiler won't
do, and that is for good reasons, because those gcc-isms are too good to
avoid.

Also, it's 2024. It's basically impossilbe that you use gcc/clang with a
version that doesn't support (gcc's) C11 variant. So standardize on
that. I don't think we currently require newer C features, so this is
sufficient for us and for now.
  • Loading branch information
thom311 committed Nov 13, 2024
1 parent 8961887 commit f307b9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ pkgconfig_DATA = \
libnl-xfrm-3.0.pc \
$(NULL)

extra_cppflags = \
-std=gnu++11 \
$(NULL)

warn_cppflags = \
-Wall \
-Wextra \
Expand Down Expand Up @@ -394,6 +398,7 @@ default_includes = \
$(NULL)

default_cppflags = \
$(extra_cppflags) \
$(warn_cppflags) \
$(defines_cppflags) \
$(default_includes) \
Expand Down

0 comments on commit f307b9b

Please sign in to comment.