# -Wlanguage-extension-token -- no, we use asm()
# -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc
# -Wextended-offsetof -- no, needed in CMS ASN1 code
+# -Wunused-function -- no, it forces header use of safestack et al
+# DEFINE macros
my $clang_devteam_warn = ""
. " -Wswitch-default"
. " -Wno-parentheses-equality"
. " -Wincompatible-pointer-types-discards-qualifiers"
. " -Wmissing-variable-declarations"
. " -Wno-unknown-warning-option"
+ . " -Wno-unused-function"
;
# This adds backtrace information to the memory leak info. Is only used
}
elsif (/^--strict-warnings$/)
{
- $strict_warnings = 1;
+ # Pretend that our strict flags is a C flag, and replace it
+ # with the proper flags later on
+ push @{$useradd{CFLAGS}}, '--ossl-strict-warnings';
+ push @{$useradd{CXXFLAGS}}, '--ossl-strict-warnings';
+ $strict_warnings=1;
}
elsif (/^--debug$/)
{
"OPENSSL_MIN_API=".($apitable->{$config{api} // ""} // -1)
];
+my @strict_warnings_collection=();
if ($strict_warnings)
{
my $wopt;
die "ERROR --strict-warnings requires gcc[>=4] or gcc-alike"
unless $gccver >= 4;
- foreach $wopt (split /\s+/, $gcc_devteam_warn)
- {
- push @{$config{cflags}}, $wopt
- unless grep { $_ eq $wopt } @{$config{cflags}};
- push @{$config{cxxflags}}, $wopt
- if ($config{CXX}
- && !grep { $_ eq $wopt } @{$config{cxxflags}});
- }
- if (defined($predefined{__clang__}))
- {
- foreach $wopt (split /\s+/, $clang_devteam_warn)
- {
- push @{$config{cflags}}, $wopt
- unless grep { $_ eq $wopt } @{$config{cflags}};
- push @{$config{cxxflags}}, $wopt
- if ($config{CXX}
- && !grep { $_ eq $wopt } @{$config{cxxflags}});
- }
- }
+ push @strict_warnings_collection, (split /\s+/, $gcc_devteam_warn);
+ push @strict_warnings_collection, (split /\s+/, $clang_devteam_warn)
+ if (defined($predefined{__clang__}));
}
+foreach (qw(CFLAGS CXXFLAGS))
+ {
+ $useradd{$_} = [ map { $_ eq '--ossl-strict-warnings'
+ ? @strict_warnings_collection
+ : ( $_ ) }
+ @{$useradd{$_}} ];
+ }
unless ($disabled{"crypto-mdebug-backtrace"})
{