GNU bug report logs - #20031
Solaris 10: <cstdlib> doesn't declare malloc, free, exit in the global namespace

Previous Next

Package: automake;

Reported by: "dclarke <at> blastwave.org" <dclarke <at> blastwave.org>

Date: Sat, 7 Mar 2015 17:28:02 UTC

Severity: normal

Tags: confirmed

Done: Mike Frysinger <vapier <at> gentoo.org>

Bug is archived. No further changes may be made.

Full log


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

From: Mathieu Lirzin <mthl <at> gnu.org>
To: "dclarke\@blastwave.org" <dclarke <at> blastwave.org>
Cc: 20031 <at> debbugs.gnu.org
Subject: Re: bug#20031: GNU Automake 1.15 fails on three "yacc" cxx related
 tests on Solaris 10 AMD64
Date: Fri, 19 Jan 2018 13:25:42 +0100
Hello,

Those test failures are/were happening because IIUC Solaris <cstdlib>
header declares malloc, free, exit only in the std namespace [1].

"dclarke <at> blastwave.org" <dclarke <at> blastwave.org> writes:

> /opt/solarisstudio12.4/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/usr/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE  -dalign -erroff=%none -errtags=yes -ftrap=%none -g -xcode=pic32 -m64 -mc -xunroll=1 -xbuiltin=%none -xtarget=opteron -xdepend=no -xnolibmopt -xlinkopt=0 -xnolibmil -xregs=no%frameptr -xs -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -c -o parse1.o parse1.cc
> "parse1.cc", line 1053: Error: The function "malloc" must have a prototype.
> "parse1.cc", line 1060: Error: The function "free" must have a prototype.
> "parse1.yy", line 10: Error: The function "exit" must have a prototype.
> "parse1.cc", line 1406: Error: The function "free" must have a prototype.
> 4 Error(s) detected.
> *** Error code 2
> make: Fatal error: Command failed for target `parse1.o'

The explicit inclusion of <cstdlib> instead of <stdlib.h> is made
because those tests want to ensure that the code is invalid C.

What would seem a more robust solution would be to include <stdlib.h>
instead and make the code invalid C by another mean.

Sorry for long delay.  Thanks for the report.

[1] https://docs.oracle.com/cd/E19205-01/819-5267/bkajw/index.html

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




This bug report was last modified 3 years and 93 days ago.

Previous Next


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