Mercurial > gnulib
changeset 37154:77a6a7e6b33a
warnings: minor optimization
Paul Eggert suggested that expr is more efficient than echo|sed.
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use fewer processes.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Thu, 15 Aug 2013 13:45:55 -0600 |
parents | 46475e57818a |
children | a2c5f4b5c47c |
files | ChangeLog m4/warnings.m4 |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Aug 14 17:02:58 2013 -0600 +++ b/ChangeLog Thu Aug 15 13:45:55 2013 -0600 @@ -1,5 +1,8 @@ 2013-08-15 Eric Blake <eblake@redhat.com> + warnings: minor optimization + * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use fewer processes. + warnings: check -Wfoo rather than -Wno-foo * m4/warnings.m4 (gl_COMPILER_OPTION_IF): If name begins with -Wno-, test if the compiler recognizes the positive form instead.
--- a/m4/warnings.m4 Wed Aug 14 17:02:58 2013 -0600 +++ b/m4/warnings.m4 Thu Aug 15 13:45:55 2013 -0600 @@ -1,4 +1,4 @@ -# warnings.m4 serial 9 +# warnings.m4 serial 10 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -29,7 +29,7 @@ [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], [gl_positive="$1" case $gl_positive in - -Wno-*) gl_positive=`echo ".$gl_positive" | sed 's/^.//; s/^-Wno-/-W/'`;; + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; esac m4_pushdef([gl_Positive], [$gl_positive])])dnl AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [