Skip to content

Commit d22797c

Browse files
committed
configure: Use -std=gnu11
Now that the minimum gcc version is 7.5, we can use C11. This will allow lots of cleanups to the code, currently hidden behind macros in include/qemu/compiler.h. Signed-off-by: Richard Henderson <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Message-Id: <[email protected]>
1 parent 1ea06ab commit d22797c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

configure

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ update_cxxflags() {
159159
# options which some versions of GCC's C++ compiler complain about
160160
# because they only make sense for C programs.
161161
QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
162-
CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu99/-std=gnu++11/)
162+
CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu11/-std=gnu++11/)
163163
for arg in $QEMU_CFLAGS; do
164164
case $arg in
165165
-Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\
@@ -538,7 +538,7 @@ QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
538538
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
539539

540540
# Flags that are needed during configure but later taken care of by Meson
541-
CONFIGURE_CFLAGS="-std=gnu99 -Wall"
541+
CONFIGURE_CFLAGS="-std=gnu11 -Wall"
542542
CONFIGURE_LDFLAGS=
543543

544544

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('qemu', ['c'], meson_version: '>=0.55.0',
2-
default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto'] +
2+
default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto'] +
33
(meson.version().version_compare('>=0.56.0') ? [ 'b_staticpic=false' ] : []),
44
version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
55

0 commit comments

Comments
 (0)