Skip to content

Commit cb3ad65

Browse files
committed
Use -std=gnu11 if available.
This supersedes -std=gnu99, and enables C11 atomics.
1 parent 213667f commit cb3ad65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,15 @@ fi
171171
if test "x$CFLAGS" = "x" ; then
172172
no_CFLAGS="yes"
173173
if test "x$GCC" = "xyes" ; then
174-
JE_CFLAGS_APPEND([-std=gnu99])
175-
if test "x$je_cv_cflags_appended" = "x-std=gnu99" ; then
174+
dnl JE_CFLAGS_APPEND([-std=gnu99])
175+
JE_CFLAGS_APPEND([-std=gnu11])
176+
if test "x$je_cv_cflags_appended" = "x-std=gnu11" ; then
176177
AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT])
178+
else
179+
JE_CFLAGS_APPEND([-std=gnu99])
180+
if test "x$je_cv_cflags_appended" = "x-std=gnu99" ; then
181+
AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT])
182+
fi
177183
fi
178184
JE_CFLAGS_APPEND([-Wall])
179185
JE_CFLAGS_APPEND([-Werror=declaration-after-statement])

0 commit comments

Comments
 (0)