[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] Warnings win over strictness in AUTOMAKE_OPTIONS.
From: |
Stefano Lattarini |
Subject: |
[PATCH 7/9] Warnings win over strictness in AUTOMAKE_OPTIONS. |
Date: |
Tue, 4 Jan 2011 18:52:32 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
This is derived from [PATCH 10/10] of the older series.
It requires a review.
Thanks,
Stefano
-*-*-
Warnings win over strictness in AUTOMAKE_OPTIONS.
This change ensures that, for what concerns the options specified
in AUTOMAKE_OPTIONS, explicitly-defined warnings always take
precedence over implicit strictness-implied warnings. This finally
fixes Automake bug#7669 a.k.a. PR/547.
* automake.in (handle_options): Call 'process_option_list' (from
Automake::Option) in way that ensures that explicit warnings are
parsed only after the strictness level has been set.
* tests/warnings-win-over-strictness.test: Extend.
---
ChangeLog | 13 +++++++++++++
automake.in | 12 +++++-------
tests/warnings-win-over-strictness.test | 18 +++++++++++++++++-
3 files changed, 35 insertions(+), 8 deletions(-)
From 8f24d48632e9af2ba4e212bb769b1e8cbb27e75f Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 20 Dec 2010 18:29:50 +0100
Subject: [PATCH 7/9] Warnings win over strictness in AUTOMAKE_OPTIONS.
This change ensures that, for what concerns the options specified
in AUTOMAKE_OPTIONS, explicitly-defined warnings always take
precedence over implicit strictness-implied warnings. This finally
fixes Automake bug#7669 a.k.a. PR/547.
* automake.in (handle_options): Call 'process_option_list' (from
Automake::Option) in way that ensures that explicit warnings are
parsed only after the strictness level has been set.
* tests/warnings-win-over-strictness.test: Extend.
---
ChangeLog | 13 +++++++++++++
automake.in | 12 +++++-------
tests/warnings-win-over-strictness.test | 18 +++++++++++++++++-
3 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index edafbfd..fa2cfd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2011-01-02 Stefano Lattarini <address@hidden>
+ For PR automake/547:
+ Warnings win over strictness in AUTOMAKE_OPTIONS.
+ This change ensures that, for what concerns the options specified
+ in AUTOMAKE_OPTIONS, explicitly-defined warnings always take
+ precedence over implicit strictness-implied warnings. This finally
+ fixes Automake bug#7669 a.k.a. PR/547.
+ * automake.in (handle_options): Call 'process_option_list' (from
+ Automake::Option) in way that ensures that explicit warnings are
+ parsed only after the strictness level has been set.
+ * tests/warnings-win-over-strictness.test: Extend.
+
+2011-01-02 Stefano Lattarini <address@hidden>
+
Change signature of 'Automake::Options::_process_option_list()'.
This only modifies internal details in the automake implementation,
bearing no externally visible effect, but preparing the way for the
diff --git a/automake.in b/automake.in
index b05a1bd..11b1ccb 100644
--- a/automake.in
+++ b/automake.in
@@ -1246,13 +1246,11 @@ sub handle_options
msg_var ('unsupported', $var,
"`AUTOMAKE_OPTIONS' cannot have conditional contents");
}
- foreach my $locvals ($var->value_as_list_recursive (cond_filter => TRUE,
- location => 1))
- {
- my ($where, $value) = @$locvals;
- return 1 if process_option_list ({ option => $value,
- where => $where});
- }
+ my (@locvals, @options);
+ @locvals = $var->value_as_list_recursive (cond_filter => TRUE,
+ location => 1);
+ @options = map { { option => $_->[1], where => $_->[0] } } @locvals;
+ return 1 if process_option_list (@options);
}
# Override portability-recursive warning.
diff --git a/tests/warnings-win-over-strictness.test
b/tests/warnings-win-over-strictness.test
index 53de473..9f6c1d9 100755
--- a/tests/warnings-win-over-strictness.test
+++ b/tests/warnings-win-over-strictness.test
@@ -40,7 +40,8 @@ ko ()
set_am_opts()
{
set +x
- sed -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" <$2 >$2-t
+ sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
+ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
mv -f $2-t $2
set -x
cat $2
@@ -50,6 +51,7 @@ set_am_opts()
touch README INSTALL NEWS AUTHORS ChangeLog COPYING
cat > Makefile.am <<END
+AUTOMAKE_OPTIONS =
FOO := bar
END
@@ -60,6 +62,8 @@ ko -Wportability --foreign
ok --gnu -Wno-portability
ok -Wno-portability --gnu
+set_am_opts '' Makefile.am
+
rm -rf autom4te*.cache
set_am_opts 'foreign -Wportability' configure.in
ko
@@ -73,4 +77,16 @@ rm -rf autom4te*.cache
set_am_opts '-Wno-portability gnu' configure.in
ok
+rm -rf autom4te*.cache
+set_am_opts '' configure.in
+
+set_am_opts 'foreign -Wportability' Makefile.am
+ko
+set_am_opts '-Wportability foreign' Makefile.am
+ko
+set_am_opts 'gnu -Wno-portability' Makefile.am
+ok
+set_am_opts '-Wno-portability gnu' Makefile.am
+ok
+
:
--
1.7.2.3
[PATCH 5/9] Add more tests about AUTOMAKE_OPTIONS., Stefano Lattarini, 2011/01/04
[PATCH 6/9] Change signature of 'Automake::Options::_process_option_list()'., Stefano Lattarini, 2011/01/04
[PATCH 7/9] Warnings win over strictness in AUTOMAKE_OPTIONS.,
Stefano Lattarini <=
[PATCH 8/9] Update NEWS about the warnings-over-strictness precedence., Stefano Lattarini, 2011/01/04
[PATCH 9/9] More checks on warnings/strictness precedence., Stefano Lattarini, 2011/01/04
[PATCH] Update docs w.r.t. warning and strictness options., Stefano Lattarini, 2011/01/15