[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning about _-variables
From: |
Alexandre Duret-Lutz |
Subject: |
Re: warning about _-variables |
Date: |
Sun, 10 Aug 2003 00:34:19 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:
adl> [http://mail.gnu.org/archive/html/bug-coreutils/2003-07/msg00052.html]
adl> Sorry for the delay.
[...]
Jim> What do you think about dropping that warning altogether,
adl> Someone complained that Automake used such variables two years
adl> ago, so I'd prefer to keep this warning so that at least
adl> Automake can test itself and be sure we don't reintroduce them
adl> by mistake.
One second thought, I agree with Paul and you. For most
packages the warning is more annoying than useful. I've tried
to tweak the test so that it complains only about Automake's
internal rules, but that looked too complicated. Let's KISS and
get rid of this.
I'm installing the following patch on branch-1-7, and its
equivalent on HEAD.
2003-08-10 Alexandre Duret-Lutz <address@hidden>
Revert the fix for PR automake/291:
* automake.in (macro_define): Do not warn about variables
starting with `_' which are an issue on NEWS-OS 4.2R. According
to Paul Eggert, NEWS-OS 4.2R is ten years old, the latest version
was released on 1996 and is not in wide use. On the other hand,
variables starting with `_' are mandatory in several situations,
so diagnosing them is more annoying than useful.
* tests/canon5.test: Do not use -Wno-portability.
* tests/vars2.test: Delete.
* tests/Makefile.am (TESTS): Remove vars2.test.
Suggested by Jim Meyering.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.52
diff -u -r1.1365.2.52 automake.in
--- automake.in 5 Aug 2003 09:25:33 -0000 1.1365.2.52
+++ automake.in 9 Aug 2003 22:32:23 -0000
@@ -6428,11 +6428,6 @@
error $where, "bad characters in variable name `$var'"
if $var !~ /$MACRO_PATTERN/o;
- # NEWS-OS 4.2R complains if a Makefile variable begins with `_'.
- msg ('portability', $where,
- "$var: Make variable names starting with `_' are not portable")
- if $var =~ /^_/;
-
# `:='-style assignments are not acknowledged by POSIX. Moreover it
# has multiple meanings. In GNU make or BSD make it means "assign
# with immediate expansion", while in OSF make it is used for
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.443.2.37
diff -u -r1.443.2.37 Makefile.am
--- tests/Makefile.am 5 Aug 2003 09:25:33 -0000 1.443.2.37
+++ tests/Makefile.am 9 Aug 2003 22:32:23 -0000
@@ -440,7 +440,6 @@
transform.test \
unused.test \
vars.test \
-vars2.test \
vars3.test \
vartar.test \
version.test \
Index: tests/canon5.test
===================================================================
RCS file: /cvs/automake/automake/tests/canon5.test,v
retrieving revision 1.5
diff -u -r1.5 canon5.test
--- tests/canon5.test 8 Sep 2002 13:07:55 -0000 1.5
+++ tests/canon5.test 9 Aug 2003 22:32:23 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -38,21 +38,18 @@
_foo_SOURCES = foo.c
END
-# Variables starting with `_' are not portable.
-$AUTOMAKE -Wno-portability || exit 1
+$AUTOMAKE || exit 1
cat > Makefile.am << 'END'
bin_PROGRAMS = ,foo
,foo_SOURCES = foo.c
END
-# Variables starting with `_' are not portable.
-$AUTOMAKE -Wno-portability && exit 1
+$AUTOMAKE && exit 1
cat > Makefile.am << 'END'
bin_PROGRAMS = ,foo
_foo_SOURCES = foo.c
END
-# Variables starting with `_' are not portable.
-$AUTOMAKE -Wno-portability
+$AUTOMAKE
Index: tests/vars2.test
===================================================================
RCS file: tests/vars2.test
diff -N tests/vars2.test
--- tests/vars2.test 8 Sep 2002 13:07:56 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,40 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
-#
-# This file is part of GNU Automake.
-#
-# GNU Automake 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 2, or (at your option)
-# any later version.
-#
-# GNU Automake 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 autoconf; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Check that Automake warns about variables starting with `_'.
-# PR/291
-
-. ./defs || exit 1
-
-set -e
-
-cat >Makefile.am <<EOF
-GOOD_ = 1
-_BAD = 2
- _bad = 3
-EOF
-
-$ACLOCAL
-# Make sure this warning is print in the `portability' category.
-$AUTOMAKE --warnings=no-error,none,portability 2>stderr
-cat stderr
-grep GOOD stderr && exit 1
-grep _BAD stderr
-grep _bad stderr
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: warning about _-variables,
Alexandre Duret-Lutz <=