GNU bug report logs - #42393
Testsuite summary for GNU Automake 1.16.1 : FAIL: 6

Previous Next

Package: automake;

Reported by: Dennis Clarke <dclarke <at> blastwave.org>

Date: Thu, 16 Jul 2020 13:58:02 UTC

Severity: normal

Tags: confirmed, help

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42393 in the body.
You can then email your comments to 42393 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Thu, 16 Jul 2020 13:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dennis Clarke <dclarke <at> blastwave.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Thu, 16 Jul 2020 13:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dennis Clarke <dclarke <at> blastwave.org>
To: bug-automake <at> gnu.org
Subject: Testsuite summary for GNU Automake 1.16.1 : FAIL: 6
Date: Thu, 16 Jul 2020 13:57:01 +0000
[Message part 1 (text/plain, inline)]

These look to be minor but on an old Solaris 10 server they do indeed
 exist :

FAIL: t/lex-clean-cxx.sh
FAIL: t/lex-depend-cxx.sh
FAIL: t/silent-many-languages.sh
FAIL: t/yacc-cxx.sh
FAIL: t/yacc-d-cxx.sh
FAIL: t/yacc-mix-c-cxx.sh

This is an Oracle/Fujitsu M-class SPARC-VII+ server under support
contract and kept fairly well up to date. The compiler tools were
the Oracle Studio 12.6 ( was Sun Studio which was Forte ) tools.

I will attach a tarball of the logs files for these tests as well
as the environment variable state and the result from configure run
which was trivial :

    ./configure --prefix=/opt/bw --disable-silent-rules

Most of the GNU toolchain that has been built thus far is very very
up to date and had no problems :

alpha$
alpha$ /opt/bw/bin/m4 --version
m4 (GNU M4) 1.4.18
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Rene' Seindal.
alpha$ /opt/bw/bin/bison --version
bison (GNU Bison) 3.6.91
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
alpha$ /opt/bw/bin/autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>,
<http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
alpha$ /opt/bw/bin/bash --version
GNU bash, version 5.0.18(1)-release (sparc-sun-solaris2.10)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
alpha$ /opt/bw/bin/gettext --version
gettext (GNU gettext-runtime) 0.20.2
Copyright (C) 1995-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
alpha$ /opt/bw/bin/idn --version
idn (GNU Libidn) 1.35
Copyright (C) 2018 Simon Josefsson.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Simon Josefsson.
alpha$ /opt/bw/bin/idn2 --version
idn2 (libidn2) 2.3.0
Copyright 2011-(C) 2019 Simon Josefsson, Tim Ruehsen.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Simon Josefsson, Tim Ruehsen.
alpha$ /opt/bw/bin/patch --version
GNU patch 2.7.6
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert
alpha$ /opt/bw/bin/perl -V 2>&1 | head -20
Summary of my perl5 (revision 5 version 32 subversion 0) configuration:

  Platform:
    osname=solaris
    osvers=2.10
    archname=sun4-solaris-64-ld
    uname='sunos alpha 5.10 generic_150400-65 sun4u sparc
sunw,sparc-enterprise '
    config_args='-Dprefix=/opt/bw -Dmksymlinks -Accflags=-m64
-xarch=sparc -g -Xa -errfmt=error -erroff=%none -errshort=full
-xstrconst -xildoff -xmemalign=8s -xnolibmil -xcode=pic32 -xregs=no%appl
-xlibmieee -mc -ftrap=%none -xbuiltin=%none -xunroll=1 -xs -L/opt/bw/lib
-I/opt/bw/include'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=define
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
alpha$

Just curious about these automake errors.

-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
[automake-1.16.1_sunos5.10_sparcv9_test_logs.tar.xz (application/x-xz, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Fri, 17 Jul 2020 21:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 42393 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: dclarke <at> blastwave.org
Cc: 42393 <at> debbugs.gnu.org
Subject: Re: bug#42393: Testsuite summary for GNU Automake 1.16.1 : FAIL: 6
Date: Fri, 17 Jul 2020 15:29:06 -0600
    These look to be minor but on an old Solaris 10 server they do indeed
     exist :

Thanks for the report. I'll look into it as soon as I have a chance,
unless another contributor gets there first (hopefully). --best, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Fri, 17 Jul 2020 21:33:02 GMT) Full text and rfc822 format available.

Message #11 received at 42393 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: dclarke <at> blastwave.org
Cc: 42393 <at> debbugs.gnu.org
Subject: Re: bug#42393: Testsuite summary for GNU Automake 1.16.1 : FAIL: 6
Date: Fri, 17 Jul 2020 15:30:10 -0600
    These look to be minor but on an old Solaris 10 server they do indeed
     exist :

Thanks for the report. I'll look into it as soon as I have a chance,
unless another contributor gets there first (hopefully). --best, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Sun, 19 Jul 2020 00:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 42393 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: dclarke <at> blastwave.org
Cc: 42393 <at> debbugs.gnu.org
Subject: Re: bug#42393: Testsuite summary for GNU Automake 1.16.1 : FAIL: 6
Date: Sat, 18 Jul 2020 18:58:30 -0600
Hi Dennis - well, looking at the logs you provided, there are indeed a
variety of errors due to differences in the compiler tools. If you or
someone else can provide patches for sparc-solaris10,
we could consider them. Unfortunately I, at least, can't come up with
fixes just from inspection. Maybe Paul or someone else can. --sorry, karl.

    FAIL: t/lex-clean-cxx.sh
/opt/developerstudio12.6/bin/CC -DPACKAGE_NAME=\"lex-clean-cxx\" -DPACKAGE_TARNAME=\"lex-clean-cxx\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"lex-clean-cxx\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lex-clean-cxx\" -DVERSION=\"1.0\" -I.   -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_FILE_OFFSET_BITS=64  -g -dalign -erroff=%none -errtags=yes -ftrap=%none -xcode=pic32 -m64 -xbuiltin=%none -xarch=sparc -xdepend=no -xregs=no%appl -c -o parsefoo.o parsefoo.cxx
"parsefoo.cxx", line 84: Error: yylex() was declared before with a different language.

    FAIL: t/lex-depend-cxx.sh
/opt/developerstudio12.6/bin/CC -DPACKAGE_NAME=\"lex-depend-cxx\" -DPACKAGE_TARNAME=\"lex-depend-cxx\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"lex-depend-cxx\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lex-depend-cxx\" -DVERSION=\"1.0\" -I.   -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_FILE_OFFSET_BITS=64  -g -dalign -erroff=%none -errtags=yes -ftrap=%none -xcode=pic32 -m64 -xbuiltin=%none -xarch=sparc -xdepend=no -xregs=no%appl -c -o joe.o joe.cc
"joe.cc", line 84: Error: yylex() was declared before with a different language.

    FAIL: t/silent-many-languages.sh
ld: fatal: file baz2.o: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to baz
(wow :)

    FAIL: t/yacc-cxx.sh
/opt/developerstudio12.6/bin/CC -DPACKAGE_NAME=\"yacc-cxx\" -DPACKAGE_TARNAME=\"yacc-cxx\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"yacc-cxx\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"yacc-cxx\" -DVERSION=\"1.0\" -I.   -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_FILE_OFFSET_BITS=64  -g -dalign -erroff=%none -errtags=yes -ftrap=%none -xcode=pic32 -m64 -xbuiltin=%none -xarch=sparc -xdepend=no -xregs=no%appl -c -o parse1.o parse1.cc
"parse1.cc", line 951: Error: The function "malloc" must have a prototype.
"parse1.cc", line 958: Error: The function "free" must have a prototype.
"parse1.yy", line 10: Error: The function "exit" must have a prototype.
"parse1.cc", line 1281: Error: The function "free" must have a prototype.

    FAIL: t/yacc-d-cxx.sh
/opt/developerstudio12.6/bin/CC -DPACKAGE_NAME=\"yacc-d-cxx\" -DPACKAGE_TARNAME=\"yacc-d-cxx\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"yacc-d-cxx\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"yacc-d-cxx\" -DVERSION=\"1.0\" -I.   -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_FILE_OFFSET_BITS=64  -g -dalign -erroff=%none -errtags=yes -ftrap=%none -xcode=pic32 -m64 -xbuiltin=%none -xarch=sparc -xdepend=no -xregs=no%appl -c -o parse.o parse.cc
"parse.cc", line 953: Error: The function "malloc" must have a prototype.
"parse.cc", line 960: Error: The function "free" must have a prototype.
"parse.cc", line 1283: Error: The function "free" must have a prototype.

    FAIL: t/yacc-mix-c-cxx.sh
/opt/developerstudio12.6/bin/CC -DPACKAGE_NAME=\"yacc-mix-c-cxx\" -DPACKAGE_TARNAME=\"yacc-mix-c-cxx\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"yacc-mix-c-cxx\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"yacc-mix-c-cxx\" -DVERSION=\"1.0\" -I. -I..   -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_FILE_OFFSET_BITS=64  -g -dalign -erroff=%none -errtags=yes -ftrap=%none -xcode=pic32 -m64 -xbuiltin=%none -xarch=sparc -xdepend=no -xregs=no%appl -c -o parse.o parse.cc
"parse.cc", line 956: Error: The function "malloc" must have a prototype.
"parse.cc", line 963: Error: The function "free" must have a prototype.
"parse.cc", line 1286: Error: The function "free" must have a prototype.




Added tag(s) help and confirmed. Request was from Karl Berry <karl <at> freefriends.org> to control <at> debbugs.gnu.org. (Sat, 21 Nov 2020 02:21:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Sun, 16 Apr 2023 16:38:03 GMT) Full text and rfc822 format available.

Message #19 received at 42393 <at> debbugs.gnu.org (full text, mbox):

From: Bogdan <bogdro_rep <at> gmx.us>
To: automake-patches <at> gnu.org, 34151 <at> debbugs.gnu.org, 42393 <at> debbugs.gnu.org,
 44795 <at> debbugs.gnu.org, 49755 <at> debbugs.gnu.org, 45205 <at> debbugs.gnu.org,
 55073 <at> debbugs.gnu.org
Subject: [PATCH][bug 34151, 42393, 44795, 49755, 45205, 55073] Fix lex/yacc
 C++ tests on Solaris/SunOS
Date: Sun, 16 Apr 2023 18:37:28 +0200
[Message part 1 (text/plain, inline)]
Hi all.

 The Solaris/SunOS lex generates C++ code with functions properly 
wrapped into >extern "C"<, but only if:

- compiling as C++ (__cplusplus is #defined),

- the feature constant __EXTERN_C__ is #defined (probably meant just 
for the SunOS compiler, not for all).

Other compilers, like GCC/G++, obviously miss the SunOS-specific 
__EXTERN_C__ and thus miss >extern "C"<, declaring the yylex() 
function as C++ (the default). This doesn't need to be a problem, but:

- the function should be declared as the user code expects it (as C 
for C programs and as C++ for C++ programs),

- the Automake lex tests for C++ re-declare the function always as a C 
function.

 The re-declarations happens probably for good reason, like for lex 
implementations which don't declare the function in advance combined 
with C/C++ compilers which always require declarations. Unfortunately, 
having the same function declared as C++ (default) first and then 
later as C causes compiler errors.

 The attached patch corrects the declarations in the following way:

- if we're in C++ mode and __EXTERN_C__ is declared (so, we're on a 
SunOS with their compiler), declare the function as C in C++ mode 
(i.e., use >extern "C"<), just like the SunOS lex does,

- if we're in C++ mode and __EXTERN_C__ is NOT declared, but also 
"__sun" is not declared (so, we're NOT on a SunOS), still assume C++ 
mode, but a different system and declare the function as C in C++ mode 
(i.e., use >extern "C"<) to support other compilers,

- if we're in C++ mode and __EXTERN_C__ is NOT declared, but also 
"__sun" IS declared (so, we ARE on a SunOS, but not using their 
compiler), declare the function as C++ in C++ mode, just like the 
SunOS lex does,

- if we're NOT in C++ mode, declare the function as C. Not the case in 
these tests, though.

 This should match what the SunOS lex/compiler do and expect which 
not braking other systems (re-checked on my Linux - works).

 Verified that the defect exists on a Solaris 11.4 Build 15 (SunOS 
5.11, GCC 7.3.0, amd64) and that the patch fixes it.

 Furthermore, I checked how GCC manages the declarations of standard 
C functions in C++. Seems so simple as saying:

	using std::some_c_library_function_name;

 which the SunOS library (or maybe just the old GCC library there) is 
not doing.
 So, it just takes this to fix the missing prototypes in C++ mode.

 In short, the patch:
- fixes the remaining part of 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34151,
- fixes the remaining part of 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42393 
(t/silent-many-languages.sh works for me),
- fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44795,
- fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49755,
- partially fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205,
- partially fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55073.

 Fortunately, these parts are just problems with the tests 
themselves, not with Automake in general.

-- 
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
[automake-sunos2-mail.diff (text/x-patch, attachment)]

Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Sun, 09 Jul 2023 16:58:03 GMT) Full text and rfc822 format available.

Notification sent to Dennis Clarke <dclarke <at> blastwave.org>:
bug acknowledged by developer. (Sun, 09 Jul 2023 16:58:03 GMT) Full text and rfc822 format available.

Message #24 received at 42393-done <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: dclarke <at> blastwave.org, dam <at> opencsw.org, yoi_no_myoujou <at> yahoo.co.jp
Cc: 42393 <at> debbugs.gnu.org, 45205 <at> debbugs.gnu.org, 44795 <at> debbugs.gnu.org,
 30612 <at> debbugs.gnu.org, 31126 <at> debbugs.gnu.org, 55073 <at> debbugs.gnu.org,
 49755 <at> debbugs.gnu.org, 15256 <at> debbugs.gnu.org, 34151 <at> debbugs.gnu.org,
 bogdro_rep <at> gmx.us
Subject: Re: bug#31126: GNU Automake 1.16.1 fails 21 tests on Solaris 10
 sparcv9
Date: Sun, 9 Jul 2023 10:57:42 -0600
Hi - you have each reported Automake test failures on Solaris.

I've just pushed a fix from Bogdan (thanks Bogdan!) for some of these,
which (sometimes with other fixes already made) closes some bugs.
Bogdan explains the details of the latest:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#13

Other problems remain and still need debugging, as Bogdan explains in:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#16

If anyone has time and interest to try bootstrapping current automake,
run the test suite, and find what still fails and why, that would be
great. --thanks, karl.

Bugs closed (with fingers crossed): 15256 30612 34151 42393 44795 49755.
Bugs still open: 31126 45205 55073.


2023-07-09  Bogdan  <bogdro_rep <at> gmx.us>

tests: avoid some SunOS declaration conflicts.

This change: finishes fixing https://bugs.gnu.org/34151
  and https://bugs.gnu.org/30612 and https://bugs.gnu.org/42393;
fixes https://bugs.gnu.org/44795 and https://bugs.gnu.org/49755;
partially fixes https://bugs.gnu.org/45205
  and https://bugs.gnu.org/55073.
Still open: https://bugs.gnu.org/15256;

* t/lex-clean-cxx.sh: test __cplusplus, __sun, and __EXTERN_C__
before using extern "C" for the yylex decl, as explained at
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#13.
* t/lex-depend-cxx.sh: likewise.

* t/yacc-cxx.sh: "using" std::exit, std::free, std::malloc.
* t/yacc-d-cxx.sh: likewise.
* t/yacc-mix-c-cxx.sh: likewise.

* NEWS: mention this.
diff --git a/NEWS b/NEWS
index 61d631ba0..23b2cc50a 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,8 @@ New in 1.17:
   - distcleancheck ignores "silly rename" files (.nfs* .smb* .__afs*)
     that can show up on network file systems.

+  - tests: avoid some declaration conflicts for lex et al. on SunOS.
+
 * Obsolescent features:

   - py-compile no longer supports Python 0.x or 1.x versions.  Python 2.0,
diff --git a/t/lex-clean-cxx.sh b/t/lex-clean-cxx.sh
index 3632d5c87..8a086304f 100644
--- a/t/lex-clean-cxx.sh
+++ b/t/lex-clean-cxx.sh
@@ -51,10 +51,15 @@ CLEANFILES = parsebaz.l++ parsequx.lpp
 LDADD = $(LEXLIB)
 END

+# For the explanation of the conditionals on using extern "C",
+# see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#13.
 cat > parsefoo.lxx << 'END'
 %{
 #define YY_DECL int yylex (void)
-extern "C" YY_DECL;
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C"
+#endif
+YY_DECL;
 #define YY_NO_UNISTD_H 1
 int isatty (int fd) { return 0; }
 %}
@@ -71,7 +76,10 @@ cp parsefoo.lxx parsebar.ll

 cat > mainfoo.cc << 'END'
 // This file should contain valid C++ but invalid C.
-extern "C" int yylex (void);
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C"
+#endif
+int yylex (void);
 using namespace std;
 int main (int argc, char **argv)
 {
diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh
index 60615a54e..682b2ccc5 100644
--- a/t/lex-depend-cxx.sh
+++ b/t/lex-depend-cxx.sh
@@ -44,10 +44,15 @@ test-obj-updated: joe.$(OBJEXT) moe.$(OBJEXT)
 	is_newest moe.$(OBJEXT) my-hdr.hxx
 END

+# For the explanation of the conditionals on using extern "C",
+# see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#13.
 cat > joe.ll << 'END'
 %{
 #define YY_DECL int yylex (void)
-extern "C" YY_DECL;
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C"
+#endif
+YY_DECL;
 #define YY_NO_UNISTD_H 1
 int isatty (int fd) { return 0; }
 %}
diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh
index 1bf75a975..5b385870c 100644
--- a/t/yacc-cxx.sh
+++ b/t/yacc-cxx.sh
@@ -49,6 +49,9 @@ cat > parse1.yy << 'END'
 // Valid C++, but deliberately invalid C.
 #include <cstdio>
 #include <cstdlib>
+using std::exit;
+using std::free;
+using std::malloc;
 // "std::" qualification required by Sun C++ 5.9.
 int yylex (void) { return std::getchar (); }
 void yyerror (const char *s) {}
diff --git a/t/yacc-d-cxx.sh b/t/yacc-d-cxx.sh
index 56f43c940..576e8e2aa 100644
--- a/t/yacc-d-cxx.sh
+++ b/t/yacc-d-cxx.sh
@@ -31,6 +31,9 @@ write_parse ()
     #include <stdlib.h>
     // Valid C++, but deliberately invalid C.
     #include <cstdlib>
+    using std::exit;
+    using std::free;
+    using std::malloc;
     #include "$header"
     int yylex (void) { return 0; }
     void yyerror (const char *s) {}
diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh
index a73935c39..7c44e0926 100644
--- a/t/yacc-mix-c-cxx.sh
+++ b/t/yacc-mix-c-cxx.sh
@@ -86,6 +86,9 @@ cat > parse.yy <<'END'
 // https://bugs.gnu.org/20031
 #include <stdlib.h>
 // Valid C++, but deliberately invalid C.
+using std::exit;
+using std::free;
+using std::malloc;
 #include <cstdlib>
 #include "parse.hh"
 int yylex (void) { return 0; }

compile finished at Sun Jul  9 09:56:41 2023




Information forwarded to bug-automake <at> gnu.org:
bug#42393; Package automake. (Sun, 09 Jul 2023 16:58:08 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Aug 2023 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.