Skip to content

Commit 16cb535

Browse files
committed
cflags.SH: don't try to add both -Wextra and -W
-W is just the older spelling of -Wextra, so don't try to add both. Also, remove the special-case logic for -W that skips adding it if -Wextra was already added. Background: -W was officially renamed to -Wextra in gcc 3.4 <https://gcc.gnu.org/gcc-3.4/changes.html>, released in April 2004. So the only case where this code had any effect was 20+ years old releases of gcc that understood -W, but not -Wextra. I don't think we need to cater to those compilers for modern perl development.
1 parent 8e4fb95 commit 16cb535

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

Cross/cflags-cross-arm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Extra warnings, used e.g. for gcc.
4-
warn="-Wall -W -Wextra -Wendif-labels -Wc++-compat"
4+
warn="-Wall -Wextra -Wendif-labels -Wc++-compat"
55
# Extra standardness.
66
stdflags=" -std=c99"
77
# Extra extra.

cflags.SH

+2-14
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,12 @@ Intel*) ;; # # Is that you, Intel C++?
182182
# longer then the ANSI C99 minimum of 4095 bytes.
183183
#
184184
# NOTE 3: the relative order of these options matters:
185-
# -Wextra before -W
186-
# -W before -Wno-long-long -Wno-declaration-after-statement
185+
# -Wextra before -Wno-long-long -Wno-declaration-after-statement
187186
#
188187
*) warns="$pedantic \
189188
-Werror=pointer-arith \
190189
-Werror=vla \
191-
-Wextra -W \
190+
-Wextra \
192191
-Wno-long-long -Wno-declaration-after-statement \
193192
-Wc++-compat -Wwrite-strings"
194193
case " $ccflags " in
@@ -221,17 +220,6 @@ Intel*) ;; # # Is that you, Intel C++?
221220
echo "cflags.SH: Adding $opt."
222221
stdflags="$stdflags $opt"
223222
;;
224-
-W)
225-
# -Wextra is the modern form of -W, so add
226-
# -W only if -Wextra is not there already.
227-
case " $warn " in
228-
*-Wextra*) ;;
229-
*)
230-
echo "cflags.SH: Adding $opt."
231-
warn="$warn $opt"
232-
;;
233-
esac
234-
;;
235223
-Werror=pointer-arith)
236224
# -pedantic* covers -Werror=p-a
237225
case "$warn" in

0 commit comments

Comments
 (0)