Use -Wall -Wextra with clang
authorEmilia Kasper <emilia@openssl.org>
Tue, 14 Apr 2015 14:04:40 +0000 (16:04 +0200)
committerEmilia Kasper <emilia@openssl.org>
Fri, 17 Apr 2015 16:17:50 +0000 (18:17 +0200)
The disabled set of -Weverything is hard to maintain across versions.
Use -Wall -Wextra but also document other useful warnings that currently trigger.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/10-main.conf
Configure

index ab269ba..aa4c76a 100644 (file)
     "linux-x86_64-clang" => {
         inherit_from     => [ "linux-x86_64" ],
         cc               => "clang",
-        cflags           => "-m64 -DL_ENDIAN -Weverything $clang_disabled_warnings -Qunused-arguments",
+        # TODO(openssl-team): fix problems and investigate if (at least) the
+        # following warnings can also be enabled:
+        # -Wconditional-uninitialized, -Wswitch-enum, -Wunused-macros,
+        # -Wmissing-field-initializers, -Wmissing-variable-declarations,
+        # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align,
+        # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
+        # -Wextended-offsetof
+        cflags           => "-m64 -DL_ENDIAN -Wall -Wextra $clang_disabled_warnings -Qunused-arguments",
     },
     "linux-x32" => {
         inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
index 1c6b424..2e70238 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -112,7 +112,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
 
 my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Wtype-limits -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DDEBUG_UNUSED";
 
-my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum -Wno-gnu-statement-expression";
+my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof";
 
 my $strict_warnings = 0;