Reference: <http://lists.gnu.org/archive/html/automake/2011-10/msg00031.html>
[Adding automake-patches] On Tuesday 01 November 2011, Stefano Lattarini wrote: > Hi Peter. > > On Sunday 30 October 2011, Peter Rosin wrote: > > > > [SNIP] > > > > Sorry for the confusion, but the latest commit from the msvc branch > > currently merged into master is 38846c5f, which was apparently merged > > via the tests-init branch. That was right before the recent round of > > AM_PROG_AR commits. And 38846c5f is just a few "obvious" changes > > after a change to the compile script, so it is a sensible point to > > merge into maint should it not be desirable to merge msvc wholesale. > > (However, from my POV, I think it is indeed desirable to just merge > > msvc into maint/branch-1.11 before the release. Of course.) > > > I mostly agree that we should just merge msvc into branch-1.11 before > the release (then we should "freeze" that branch but for bug-fixes, > and start doing lots of tests). > > *BUT*, I don't like the idea that a "mere" bug-fixing version will > introduce new warnings enabled by `-Wall' and fatal under `-Werror' > (even if I've already agreed that doing so for 1.12 is perfectly > fine -- a statement that I'm not recanting!). > > Here is waht we should do IMHO: > > 1. Merge latest maint into msvc and master, merge msvc into master. > Done (see relevant recent messages on automake-patches). > 2. Create a new public branch `msvc-for-1.11', based off of > `msvc'. > I've instead based `msvc-for-1.11' on a merge of `branch-1.11' and `msvc'. > 3. Commit a change in this new branch, ensuring that either: > [3a] the `extra-portability' warnings are *not* fatal, even > with `Werror'; or that: > [3b] the `extra-portability' warnings are *not* enabled by > `-Wall'. > And we should also tweak the NEWS file accordingly (but not > the docuemntation IMHO). > This change is *not* to be merged into either master or msvc, > obviously. > I went for [3b]. Attached is what I've pushed. > 4. Merge `msvc-for-1.11' into `branch-1.11'. > Will do once we I have some ACK from Peter or Ralf, or in a week for now if no objection nor regression crops up. > 5. Test test test ... > Here, I could use a little help for more windows-savvy contributors ... ;-) Regards, Stefano
From 213f5ef34632205139c3b483a73cbf20117786e4 Mon Sep 17 00:00:00 2001 Message-Id: <213f5ef34632205139c3b483a73cbf20117786e4.1320402924.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Fri, 4 Nov 2011 11:26:51 +0100 Subject: [PATCH] warnings: 'extra-portability' category is not implied by '-Wall' This change is only intended for the 1.11.x series. In automake 1.12, `-Wall' will be meant to enable `-Wextra-portability'. * lib/Automake/ChannelDefs.pm (switch_warning): Do not enable extra-portability warnings when `-Wall' is given. Use ... ($have_extra_portability ): ... this new global variable. Add a trailing "1;" to avoid spurious errors upon the importing of this module. * tests/extra-portability.test: Update and extend. * NEWS: Update. --- ChangeLog | 13 +++++++++++++ NEWS | 6 +++++- lib/Automake/ChannelDefs.pm | 22 ++++++++++++++++++---- tests/extra-portability.test | 27 ++++++++++++++++++++++++++- 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8133c9..b43e29d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-11-04 Stefano Lattarini <stefano.lattar...@gmail.com> + + warnings: 'extra-portability' category is not implied by '-Wall' + This change is only intended for the 1.11.x series. In automake + 1.12, `-Wall' will be meant to enable `-Wextra-portability'. + * lib/Automake/ChannelDefs.pm (switch_warning): Do not enable + extra-portability warnings when `-Wall' is given. Use ... + ($have_extra_portability ): ... this new global variable. + Add a trailing "1;" to avoid spurious errors upon the importing + of this module. + * tests/extra-portability.test: Update and extend. + * NEWS: Update. + 2011-11-03 Stefano Lattarini <stefano.lattar...@gmail.com> tests: various minor tweakings, mostly related to AM_PROG_AR diff --git a/NEWS b/NEWS index f648e6f..8f47b19 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ New in 1.11.1a: search path are looked up is probably going to be changed in the next Automake release (1.12). + - Starting from the next Automake release (1.12), warnings in the + `extra-portability' category will be enabled by `-Wall' (right now, + one has to use `-Wextra-portability' explicitly). + * Changes to aclocal: - The `--acdir' option is deprecated. Now you should use the new options @@ -46,7 +50,7 @@ New in 1.11.1a: - New macro AM_PROG_AR that looks for an archiver and wraps it in the new 'ar-lib' auxiliary script if the found archiver is Microsoft lib. This new macro is required for LIBRARIES and LTLIBRARIES when automake is - run with -Wextra-portability (or -Wall) and -Werror. + run with -Wextra-portability and -Werror. - When using DejaGnu-based testsuites, the user can extend the `site.exp' file generated by automake-provided rules by defining the special make diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index 61b4ed4..8dff186 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -258,6 +258,10 @@ Else handle C<all> and C<none> for completeness. =cut +# HACK to have `-Wextra-portability' *not* implied by `-Wall'. +# This will go away in automake 1.12. +my $have_extra_portability = 0; + sub switch_warning ($) { my ($cat) = @_; @@ -272,6 +276,8 @@ sub switch_warning ($) if ($cat eq 'all') { setup_channel_type 'warning', silent => $has_no; + setup_channel 'extra-portability', silent => 1 + unless $have_extra_portability; } elsif ($cat eq 'none') { @@ -290,10 +296,16 @@ sub switch_warning ($) setup_channel $cat, silent => $has_no; setup_channel 'portability-recursive', silent => $has_no if $cat eq 'portability'; - setup_channel 'extra-portability', silent => $has_no - if ($cat eq 'portability' && $has_no); - setup_channel 'portability', silent => $has_no - if ($cat eq 'extra-portability' && ! $has_no); + if ($cat eq 'portability' && $has_no) + { + setup_channel 'extra-portability', silent => 1; + $have_extra_portability = 0; + } + if ($cat eq 'extra-portability' && ! $has_no) + { + setup_channel 'portability', silent => 0; + $have_extra_portability = 1; + } } else { @@ -382,6 +394,8 @@ sub set_strictness ($) } } +1; + =back =head1 SEE ALSO diff --git a/tests/extra-portability.test b/tests/extra-portability.test index 191dcb4..ce833b4 100755 --- a/tests/extra-portability.test +++ b/tests/extra-portability.test @@ -18,6 +18,7 @@ # warning categories: # 1. `-Wextra-portability' must imply `-Wportability'. # 2. `-Wno-portability' must imply `-Wno-extra-portability'. +# 3. `-Wall' does *not* imply `-Wextra-portability'. . ./defs || Exit 1 @@ -32,11 +33,22 @@ END cat >Makefile.am <<END EXTRA_LIBRARIES = libfoo.a libfoo_a_SOURCES = sub/foo.c -libfoo_a_CPPFLAGS = -Dwhatever END $ACLOCAL +# `-Wall' does not enable extra-portability warnings. +$AUTOMAKE -Wall -Werror + +# Enabling extra-portability works. +AUTOMAKE_fails -Wnone -Wextra-portability +grep 'requires.*AM_PROG_AR' stderr +# Disabling portability disables extra-portability. +$AUTOMAKE -Wno-portability -Wall +$AUTOMAKE -Wextra-portability -Wno-portability -Wall + +echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am + # Enabling extra-portability enables portability. AUTOMAKE_fails -Wnone -Wextra-portability # The expected diagnostic is @@ -47,6 +59,12 @@ AUTOMAKE_fails -Wnone -Wextra-portability grep 'requires.*AM_PROG_CC_C_O' stderr grep 'requires.*AM_PROG_AR' stderr +# `-Wall' does not reset extra portability warnings to their +# default (i.e., disabled). +AUTOMAKE_fails -Wextra-portability -Wall +grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'requires.*AM_PROG_AR' stderr + # Disabling extra-portability leaves portability intact. AUTOMAKE_fails -Wno-extra-portability # The expected diagnostic is @@ -55,6 +73,12 @@ AUTOMAKE_fails -Wno-extra-portability grep 'requires.*AM_PROG_CC_C_O' stderr grep 'requires.*AM_PROG_AR' stderr && Exit 1 +# `-Wall' does not set extra portability warnings if they have +# been previously disabled. +AUTOMAKE_fails -Wno-extra-portability -Wall +grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'requires.*AM_PROG_AR' stderr && Exit 1 + # Enabling portability does not enable extra-portability. AUTOMAKE_fails -Wnone -Wportability # The expected diagnostic is @@ -65,5 +89,6 @@ grep 'requires.*AM_PROG_AR' stderr && Exit 1 # Disabling portability disables extra-portability. $AUTOMAKE -Wno-portability +$AUTOMAKE -Wextra-portability -Wno-portability : -- 1.7.2.3