Skip to content

Commit f6d975d

Browse files
fxlbguyharris
authored andcommitted
Autoconf, CMake: Add a warning flag (-Wcomma)
Use of comma as statement separator is discouraged and reported as warning by clang with -Wcomma.
1 parent 3653d62 commit f6d975d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
12011201
check_and_add_compiler_option(-Wall)
12021202
check_and_add_compiler_option(-Wassign-enum)
12031203
check_and_add_compiler_option(-Wcast-qual)
1204+
check_and_add_compiler_option(-Wcomma)
12041205
check_and_add_compiler_option(-Wmissing-prototypes)
12051206
check_and_add_compiler_option(-Wmissing-variable-declarations)
12061207
check_and_add_compiler_option(-Wold-style-definition)

aclocal.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ AC_DEFUN(AC_LBL_DEVEL,
807807
AC_LBL_CHECK_COMPILER_OPT($1, -Wall)
808808
AC_LBL_CHECK_COMPILER_OPT($1, -Wassign-enum)
809809
AC_LBL_CHECK_COMPILER_OPT($1, -Wcast-qual)
810+
AC_LBL_CHECK_COMPILER_OPT($1, -Wcomma)
810811
AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes)
811812
AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-variable-declarations)
812813
AC_LBL_CHECK_COMPILER_OPT($1, -Wnull-pointer-subtraction)

0 commit comments

Comments
 (0)