GNU bug report logs -
#62886
[PATCH][bug 34151, 42393, 44795, 49755, 45205, 55073] Fix lex/yacc C++ tests on Solaris/SunOS
Previous Next
Reported by: Bogdan <bogdro_rep <at> gmx.us>
Date: Sun, 16 Apr 2023 16:38:01 UTC
Severity: normal
Tags: patch
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 62886 in the body.
You can then email your comments to 62886 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
automake-patches <at> gnu.org
:
bug#62886
; Package
automake-patches
.
(Sun, 16 Apr 2023 16:38:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Bogdan <bogdro_rep <at> gmx.us>
:
New bug report received and forwarded. Copy sent to
automake-patches <at> gnu.org
.
(Sun, 16 Apr 2023 16:38:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[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)]
Information forwarded
to
automake-patches <at> gnu.org
:
bug#62886
; Package
automake-patches
.
(Sun, 16 Apr 2023 16:45:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 62886 <at> debbugs.gnu.org (full text, mbox):
The bugtracker erroneously thought my previous mail was a new bug
report...
To be closed/deleted, just like
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60419.
--
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
Information forwarded
to
automake-patches <at> gnu.org
:
bug#62886
; Package
automake-patches
.
(Sun, 28 May 2023 01:23:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 62886 <at> debbugs.gnu.org (full text, mbox):
Closing bug as suggested. Mailing or cc-ing NNNN-done <at> debbugs.gnu.org
will close a bug.
To be closed/deleted, just like
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60419.
Merging that one. --thanks, karl.
Reply sent
to
Karl Berry <karl <at> freefriends.org>
:
You have taken responsibility.
(Sun, 28 May 2023 01:23:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Bogdan <bogdro_rep <at> gmx.us>
:
bug acknowledged by developer.
(Sun, 28 May 2023 01:23:03 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
.
(Sun, 25 Jun 2023 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 321 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.