Skip to content

Commit

Permalink
chore(build): replace -Wc++-compat' with -x c++'
Browse files Browse the repository at this point in the history
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: #578, branch: aws-nslick/stack/25
Signed-off-by: Nicholas Sielicki <[email protected]>
  • Loading branch information
aws-nslick committed Sep 12, 2024
1 parent ac70e3e commit 10b1f6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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}"],
Expand Down

0 comments on commit 10b1f6d

Please sign in to comment.