diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2019-02-11 13:22:49 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-02-12 01:34:12 +0100 |
commit | 8ed561e1f13d0afb019a7963238bdd43ad017bec (patch) | |
tree | 6eb6ab8174ada8d4abadb6127665e1c88a90fbbb /configure.ac | |
parent | lib: a few more trivial changes for C++ compatibility (diff) | |
download | frr-8ed561e1f13d0afb019a7963238bdd43ad017bec.tar.xz frr-8ed561e1f13d0afb019a7963238bdd43ad017bec.zip |
tests: add C++ header compatibility smoke test
Compiling an empty C file with most headers included and -Wc++-compat
gives us a build error if we introduce some stupid C++-incompatible
change.
While this won't catch everything, it's a good start.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 0c15b501f..20aa69116 100755 --- a/configure.ac +++ b/configure.ac @@ -147,7 +147,7 @@ dnl - specifically, options to control warnings AC_USE_SYSTEM_EXTENSIONS AC_DEFUN([AC_C_FLAG], [{ - m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-],[___])]) + m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+],[____])]) AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [ AC_LANG_PUSH([C]) ac_c_flag_save="$CFLAGS" @@ -261,6 +261,9 @@ fi AC_C_FLAG([-Wno-unused-parameter]) AC_C_FLAG([-Wno-missing-field-initializers]) +AC_C_FLAG([-Wc++-compat], [], [CXX_COMPAT_CFLAGS="-Wc++-compat"]) +AC_SUBST([CXX_COMPAT_CFLAGS]) + dnl ICC emits a broken warning for const char *x = a ? "b" : "c"; dnl for some reason the string consts get 'promoted' to char *, dnl triggering a const to non-const conversion warning. |