[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] New channel `portability-recursive'.
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH 1/4] New channel `portability-recursive'. |
Date: |
Mon, 9 Mar 2009 21:22:44 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
* Ralf Wildenhues wrote on Sun, Mar 08, 2009 at 10:18:51AM CET:
> This warning channel is currently turned on by -Wall, but it should also
> be turned on by -Wportability, I guess; or get its own switch. As noted
> in some of the earlier discussions, recursive $(var1$(var2)) variable
> expansions are in practice found to be rather portable (when the inner
> variable uses ${..} or $(..), not plain $..).
Fixed with this patch, pushed to the branch.
Cheers,
Ralf
Let -Wportability turn on/off the portability-recursive channel.
* lib/Automake/ChannelDefs.pm (switch_warning): switch
`portability-recursive' channel as well if chaning `portability'
channel.
* tests/dollarvar2.test: New test.
* tests/Makefile.am: Update.
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index 60520b7..436a904 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -281,6 +281,8 @@ sub switch_warning ($)
elsif (channel_type ($cat) eq 'warning')
{
setup_channel $cat, silent => $has_no;
+ setup_channel 'portability-recursive', silent => $has_no
+ if $cat eq 'portability';
}
else
{
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9b66bff..a1af65d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -241,6 +241,7 @@ distdir.test \
distname.test \
dollar.test \
dollarvar.test \
+dollarvar2.test \
double.test \
dup2.test \
else.test \
diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test
new file mode 100755
index 0000000..676cde2
--- /dev/null
+++ b/tests/dollarvar2.test
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test to make sure that -Wportability turns on portability-recursive,
+# likewise for -Wno-...
+
+. ./defs
+
+set -e
+
+cat >Makefile.am <<'EOF'
+x = 1
+bla = $(foo$(x))
+EOF
+
+$ACLOCAL
+
+# $AUTOMAKE already contains -Wall -Werror.
+AUTOMAKE_fails -Wportability
+$AUTOMAKE --force -Wno-all
+$AUTOMAKE --force -Wno-portability
+echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
+$AUTOMAKE --force
+
+: