Add -Werror=pointer-arith by default
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Tue, 8 Aug 2017 10:41:08 +0000 (11:41 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Thu, 17 Aug 2017 11:42:17 +0000 (12:42 +0100)
The core is already clean for this.

cflags.SH
pod/perlhacktips.pod

index 3af1e97..c2a529b 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -188,6 +188,7 @@ Intel*) ;; # # Is that you, Intel C++?
 #
 *)  for opt in -std=c89 -ansi $pedantic \
                -Werror=declaration-after-statement \
+               -Werror=pointer-arith \
                -Wextra -W \
                -Wc++-compat -Wwrite-strings
     do
@@ -247,6 +248,16 @@ Intel*) ;; # # Is that you, Intel C++?
                      ;;
                   esac
                   ;;
+               -Werror=pointer-arith)
+                  # -pedantic* covers -Werror=p-a
+                  case "$warn" in
+                  *-pedantic*) ;;
+                  *)
+                     echo "cflags.SH: Adding $opt."
+                     warn="$warn $opt"
+                     ;;
+                  esac
+                  ;;
                *)
                   echo "cflags.SH: Adding $opt."
                   warn="$warn $opt"
@@ -367,7 +378,8 @@ case "$cc" in
   ;;
 esac
 
-for f in -Wdeclaration-after-statement -Werror=declaration-after-statement
+for f in -Wdeclaration-after-statement -Werror=declaration-after-statement \
+         -Wpointer-arith -Werror=pointer-arith
 do
   case "$cppflags" in
   *"$f"*)
index eef21ca..773b4df 100644 (file)
@@ -1130,6 +1130,10 @@ C<-Wwrite-strings>
 
 C<-Werror=declaration-after-statement>
 
+=item *
+
+C<-Werror=pointer-arith>
+
 =back
 
 The following flags would be nice to have but they would first need
@@ -1139,10 +1143,6 @@ their own Augean stablemaster:
 
 =item *
 
-C<-Wpointer-arith>
-
-=item *
-
 C<-Wshadow>
 
 =item *