From ffd90fdbc3e198ae0b41899f510195b46495d55e Mon Sep 17 00:00:00 2001 From: Nicholas Sielicki Date: Wed, 4 Sep 2024 18:54:19 -0700 Subject: [PATCH] chore(build): replace `-Wc++-compat' with `-x c++' As of this commit, a build with CFLAGS="-x c++" succeeds; ie: all source files in the tree are both valid C++ source code AND valid C code. Convert wcpp-compat distcheck builds to actually build with C++, to prevent future pull requests from breaking C++ compatibility going forward. stack-info: PR: https://github.com/aws/aws-ofi-nccl/pull/578, branch: aws-nslick/stack/25 Signed-off-by: Nicholas Sielicki --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 02b3bd83d..18247b790 100644 --- a/configure.ac +++ b/configure.ac @@ -144,14 +144,14 @@ AC_DEFINE_UNQUOTED([OFI_NCCL_TRACE], [${trace}], [Defined to 1 unit test output AC_ARG_ENABLE([picky-compiler], [AS_HELP_STRING([--disable-picky-compiler], [Disable adding picky compiler flags.])]) AS_IF([test "${enable_picky_compiler}" != "no"], - [picky_compiler_flags="-Wall -Wc++-compat -Wextra -Wno-unused-parameter" + [picky_compiler_flags="-Wall -Wextra -Wno-unused-parameter" AC_MSG_NOTICE([Adding ${picky_compiler_flags} to CFLAGS.]) CFLAGS="${CFLAGS} ${picky_compiler_flags}" AS_UNSET([picky_compiler_flags])]) AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Enable setting -Werror. Off by default, unless building from Git tree.])]) -werror_flags="-Werror -Wno-error=unused-parameter -Wno-error=missing-field-initializers" +werror_flags="-Werror -Wno-error=unused-parameter -Wno-error=missing-field-initializers -x c++" AS_IF([test -d "${srcdir}/.git" -a -z "${enable_werror}"], [AC_MSG_NOTICE([Found .git directory. Adding ${werror_flags} to CFLAGS.]) CFLAGS="${CFLAGS} ${werror_flags}"],