From 13efe9d17e7ee522c5aaa07f3076184161ede61f Mon Sep 17 00:00:00 2001 From: Emilia Kasper Date: Tue, 14 Apr 2015 16:04:40 +0200 Subject: [PATCH] Use -Wall -Wextra with clang 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 --- Configurations/10-main.conf | 9 ++++++++- Configure | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index ab269ba4d9..aa4c76acfa 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -641,7 +641,14 @@ "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") ], diff --git a/Configure b/Configure index 1c6b424817..2e70238bc7 100755 --- a/Configure +++ b/Configure @@ -112,7 +112,7 @@ my $usage="Usage: Configure [no- ...] [enable- ...] [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;