]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: avoid spurious failures in tests on C++ and lex
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 11 Apr 2012 13:25:37 +0000 (15:25 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 11 Apr 2012 13:25:37 +0000 (15:25 +0200)
This is a follow-up to commit v1.11-2128-g7f2bc63 of 09-04-2012,
"tests: avoid spurious failures with non-flex 'lex' programs and
C++".  It is required to avoid a couple of spurious failures on
Solaris and NetBSD systems (at least).  See also automake bug#11185.

* t/lex-clean-cxx.sh (parsefoo.lxx): Do not declared the provided
dummy 'isatty' function as 'static', since that might conflict with
a declaration of it as 'extern' pulled in through other system
* t/lex-depend-cxx.sh (joe.ll): Likewise.
* t/README: Update advice, to avoid similar issues in the future.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/README
t/lex-clean-cxx.sh
t/lex-depend-cxx.sh

index 06ead7497a822842eeda05519aa95828be237ab8..75dae9e206db2bd719c03814c218dd3b86389bf5 100644 (file)
--- a/t/README
+++ b/t/README
@@ -260,7 +260,7 @@ Do
     %}
   to accommodate non-ANSI systems, since GNU flex generates code that
   includes unistd.h otherwise.  Also add:
-    static int isatty (int fd) { return 0; }
+    int isatty (int fd) { return 0; }
   to the definitions section if the generated code is to be compiled
   by a C++ compiler, for similar reasons (i.e., the isatty(3) function
   from that same unistd.h header would be required otherwise).
index 4089f0e2b5d12c15c331c3bfc3837ce1938efaef..1c5752425e8130ab61461dddd4a7d7456e6a4c7e 100755 (executable)
@@ -55,7 +55,7 @@ END
 cat > parsefoo.lxx << 'END'
 %{
 #define YY_NO_UNISTD_H 1
-static int isatty (int fd) { return 0; }
+int isatty (int fd) { return 0; }
 %}
 %%
 "GOOD"   return EOF;
index 8e7a2391c43179c46024fa381b83ab48cb8ca873..490516f0e5d59a9b70e5c16b7dee5e63dc699cf9 100755 (executable)
@@ -48,7 +48,7 @@ END
 cat > joe.ll << 'END'
 %{
 #define YY_NO_UNISTD_H 1
-static int isatty (int fd) { return 0; }
+int isatty (int fd) { return 0; }
 %}
 %%
 "foo" return EOF;