Skip to content

Commit

Permalink
configure.ac: fix C++11 support check
Browse files Browse the repository at this point in the history
* with -Werror=return-type in CFLAGS this test fails with:

  configure:4290: checking for C++11 support or better
  configure:4303: x86_64-webos-linux-g++  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type --sysroot=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/recipe-sysroot -c  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/rdfind-1.5.0=/usr/src/debug/rdfind/1.5.0-r0  -fdebug-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/rdfind-1.5.0=/usr/src/debug/rdfind/1.5.0-r0  -fmacro-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/build=/usr/src/debug/rdfind/1.5.0-r0  -fdebug-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/build=/usr/src/debug/rdfind/1.5.0-r0  -fdebug-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/recipe-sysroot=  -fmacro-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/recipe-sysroot=  -fdebug-prefix-map=/OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/rdfind/1.5.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden   conftest.cpp >&5
  conftest.cpp: In function 'int f()':
  conftest.cpp:22:20: error: no return statement in function returning non-void [-Werror=return-type]
     22 | int f() { auto a=1;}                                                                                                                                                                                                                        |                    ^
  cc1plus: some warnings being treated as errors
  ...
  configure:4308: error: no c++11 support, please set CXXFLAGS properly

* fix the test to pass

Signed-off-by: Martin Jansa <[email protected]>
  • Loading branch information
shr-project authored and Paul Dreik committed Jun 17, 2023
1 parent b92e9a7 commit 6dc1223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AC_SYS_LARGEFILE

dnl make sure we have c++11 or better,
AC_MSG_CHECKING([for C++11 support or better])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { auto a=1;}])],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { auto a=1;return a;}])],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([no c++11 support, please set CXXFLAGS properly])])

Expand Down

0 comments on commit 6dc1223

Please sign in to comment.