From: Junio C Hamano Date: Thu, 5 Feb 2015 22:18:45 +0000 (-0800) Subject: Meta/Make: make it strict by default X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1eae6908f5327c4c1a607cab1c449e71a08c7d7;p=thirdparty%2Fgit.git Meta/Make: make it strict by default --- diff --git a/Dothem b/Dothem index f8affa86ab..cff2949a9e 100755 --- a/Dothem +++ b/Dothem @@ -31,6 +31,7 @@ while case "$1" in --base=*) BUILDBASE=${1#*=} ;; --branches=*) branches=${1#*=} ;; -j*) jobs=$1 ;; + --) shift; break ;; -*) echo >&2 "Unknown option: $1"; exit 1 ;; *) break ;; esac @@ -195,7 +196,7 @@ do save=$(git rev-parse HEAD) && - Meta/Make $M ${test+"$test"} $jobs -- ${with_dash:+SHELL_PATH=/bin/dash} $dotest && + Meta/Make $M ${test+"$test"} $jobs -- ${with_dash:+SHELL_PATH=/bin/dash} "$@" $dotest && { test -n "$skip_doc" || @@ -212,7 +213,7 @@ do test z$install = znoinstall || if test "$save" = "$(git rev-parse HEAD)" then - Meta/Make $M -- ${with_dash:+SHELL_PATH=/bin/dash} install + Meta/Make $M -- ${with_dash:+SHELL_PATH=/bin/dash} "$@" install else echo >&2 "Head moved--not installing" fi diff --git a/Make b/Make index 70be5d6d9a..21771a669e 100755 --- a/Make +++ b/Make @@ -96,21 +96,20 @@ determine_long_version () { sed -e 's/-/./g' } +case "$NO_PEDANTIC" in +?*) ;; +'') + PEDANT="-Werror -Wold-style-definition -std=c99 $PEDANT" + PEDANT="-Wpointer-arith -Woverflow -Wunused $PEDANT" + PEDANT="-Wold-style-declaration -Wstrict-prototypes $PEDANT" + ;; +esac + while case $# in 0) break ;; esac do case "$1" in - -pedantic | --pedantic) - case "$NO_PEDANTIC" in - ?*) ;; - '') - O="-Werror -Wold-style-definition -std=c99 $O" - O="-Wno-pointer-to-int-cast $O" - O="-Wpointer-arith -Woverflow -Wunused $O" - O="-Wold-style-declaration -Wstrict-prototypes $O" - ;; - esac - # -Wvla - # O="$O -fwrapv -fno-strict-overflow" + --pedantic) + echo >&2 "(no need to say --pedantic)" ;; -j*) case "$NO_JOBS" in @@ -122,7 +121,7 @@ do oldtest=t ;; -loose | --loose) - Wall= + PEDANT= Wall= ;; --locale=*) LANG=${1#*=} @@ -153,6 +152,7 @@ do esac shift done +O="${PEDANT}${PEDANT:+ }$O" test -f /bin/dash || with_dash=