summaryrefslogtreecommitdiff
path: root/maint
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-12-06 16:21:06 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-12-06 16:21:06 +0000
commit27304543723ca5af9f2da68fc9395e2a134054f2 (patch)
tree72d13a4e2630eae15beea6a7438ec6d74919e0e1 /maint
parentcea7bf225c200f5c599ef2edf3bc881176b7a74f (diff)
downloadpcre-27304543723ca5af9f2da68fc9395e2a134054f2.tar.gz
When running the tests for many different configurations, add compiler warning
switches when gcc is being used, and fail if any warnings are generated. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1410 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'maint')
-rwxr-xr-xmaint/ManyConfigTests29
1 files changed, 25 insertions, 4 deletions
diff --git a/maint/ManyConfigTests b/maint/ManyConfigTests
index 63e937f..18476d0 100755
--- a/maint/ManyConfigTests
+++ b/maint/ManyConfigTests
@@ -24,9 +24,29 @@ if [ "$1" = "-v" ] ; then verbose=1; fi
tmp=/tmp/pcretesting
# Don't bother with compiler optimization; it just slows down compilation a lot
-# (and these tests themselves are quick).
+# (and running the tests themselves is quick).
CFLAGS="-g -O0"
+CXXFLAGS="$CFLAGS"
+
+# If the compiler is gcc, add a lot of warning switches.
+
+cc --version >zzz 2>/dev/null
+if [ $? -eq 0 ] && grep GCC zzz >/dev/null; then
+ CFLAGS="$CFLAGS -Wall"
+ CFLAGS="$CFLAGS -Wno-overlength-strings"
+ CFLAGS="$CFLAGS -Wpointer-arith"
+ CFLAGS="$CFLAGS -Wwrite-strings"
+ CFLAGS="$CFLAGS -Wundef -Wshadow"
+ CFLAGS="$CFLAGS -Wextra -Wformat"
+ CFLAGS="$CFLAGS -Wbad-function-cast"
+ CFLAGS="$CFLAGS -Wmissing-declarations"
+ CFLAGS="$CFLAGS -Wnested-externs"
+ CFLAGS="$CFLAGS -pedantic"
+ CFLAGS="$CFLAGS -Wuninitialized"
+ CFLAGS="$CFLAGS -Wmissing-prototypes"
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+fi
# This function runs a single test with the set of configuration options that
@@ -44,7 +64,7 @@ function runtest()
echo " $opts"
fi
- CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" \
+ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
$srcdir/configure $opts >/dev/null 2>teststderr
if [ $? -ne 0 ]; then
@@ -56,9 +76,10 @@ function runtest()
echo "Making"
make >/dev/null 2>teststderr
- if [ $? -ne 0 ]; then
+ if [ $? -ne 0 -o -s teststderr ]; then
echo " "
- echo "**** Error while making ****"
+ echo "**** Errors or warnings while making ****"
+ echo " "
cat teststderr
exit 1
fi