From 3e94579a5afa459641856d104008a1f5dc387fdd Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Sat, 26 Jan 2019 18:19:50 +0100 Subject: [PATCH] Enable warning flag -Wenum-conversion if the compiler supports it. This picks up some enum type confusion, and so looks useful. Unfortunately only Clang seems to have it; gcc doesn't. --- Makefile.all.am | 1 + configure.ac | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile.all.am b/Makefile.all.am index 4a29695cce..8ea95a6118 100644 --- a/Makefile.all.am +++ b/Makefile.all.am @@ -114,6 +114,7 @@ AM_CFLAGS_BASE = \ @FLAG_W_IGNORED_QUALIFIERS@ \ @FLAG_W_MISSING_PARAMETER_TYPE@ \ @FLAG_W_LOGICAL_OP@ \ + @FLAG_W_ENUM_CONVERSION@ \ @FLAG_W_OLD_STYLE_DECLARATION@ \ @FLAG_FNO_STACK_PROTECTOR@ \ @FLAG_FSANITIZE@ \ diff --git a/configure.ac b/configure.ac index 289514ff15..35c6f744b5 100644 --- a/configure.ac +++ b/configure.ac @@ -2112,6 +2112,7 @@ AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION]) AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS]) AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE]) AC_GCC_WARNING_SUBST([logical-op], [FLAG_W_LOGICAL_OP]) +AC_GCC_WARNING_SUBST([enum-conversion], [FLAG_W_ENUM_CONVERSION]) # Does this compiler support -Wformat-security ? # Special handling is needed, because certain GCC versions require -Wformat -- 2.47.2