Make the match for previous cflags a bit more strict
authorRichard Levitte <levitte@openssl.org>
Mon, 9 Nov 2015 08:50:56 +0000 (09:50 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 9 Nov 2015 11:15:07 +0000 (12:15 +0100)
./Configure [target] --strict-warnings -Wno-pedantic-ms-format
would not add '-pedantic' because it matches '-Wno-pedantic-ms-format',
which was added first.

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 6703c4ea87b30554283deaa5df1f8d68725d3ee4)

Configure

index c9dedcd37dc3511d84cb1693e03c53e1eaae5e1b..fdf8d9a97eec896d653778e9dc05b7c0ccbc1907 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1584,13 +1584,13 @@ if ($strict_warnings)
        die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
        foreach $wopt (split /\s+/, $gcc_devteam_warn)
                {
-               $cflags .= " $wopt" unless ($cflags =~ /$wopt/)
+               $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
                }
        if ($ecc eq "clang")
                {
                foreach $wopt (split /\s+/, $clang_devteam_warn)
                        {
-                       $cflags .= " $wopt" unless ($cflags =~ /$wopt/)
+                       $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
                        }
                }
        }