Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 1997 06:18:16 -0800 (PST)
From:      bertram@ifib.uni-karlsruhe.de
To:        freebsd-gnats-submit@freebsd.org
Subject:   bin/3080: yacc produces output which doesn't compile with g++  [call of getenv()]
Message-ID:  <199703241418.GAA09476@freefall.freebsd.org>
Resent-Message-ID: <199703241420.GAA09564@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3080
>Category:       bin
>Synopsis:       yacc produces output which doesn't compile with g++  [call of getenv()]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 06:20:01 PST 1997
>Last-Modified:
>Originator:     Bertram Barth
>Organization:
private
>Release:        2.1.6 Release
>Environment:
>Description:
yacc-generated output holds a code sequence 

	extern char getenv();
	xxx = getenv("XXX");

which makes C++ compilers like g++ complain/fail because of 
prototype mismatch.
>How-To-Repeat:

>Fix:
yacc/skeleton.c

No good idea, since most solutions depend on previous #include statements,
like surround offending declaration with __BEGIN_DECLS/__BEGIN_DECLS

Maybe:
#if defined(__cplusplus)
extern "C" {
#endif
	extern char getenv();
#if defined(__cplusplus)
 };
#endif



>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703241418.GAA09476>