delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/11/22/02:00:16

Date: Thu, 22 Nov 2001 08:39:30 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
X-Sender: pavenis AT ieva06
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: GCC option -ansi and libstdc++-v3
In-Reply-To: <4331-Wed21Nov2001201010+0200-eliz@is.elta.co.il>
Message-ID: <Pine.A41.4.05.10111220836130.22820-100000@ieva06>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Wed, 21 Nov 2001, Eli Zaretskii wrote:

> > Date: Wed, 21 Nov 2001 18:42:03 +0200 (WET)
> > From: Andris Pavenis <pavenis AT lanet DOT lv>
> > 
> > gcc -ansi defines __STRICT_ANSI__ which hides prototypes for some
> > function needed by libstdc++-v3. Here are some examples one 
> > can find quickly:
> > 	lrand48()  (recent report today about compilation errors)
> > 	strtoll() and strtoull() are also used 
> > 	maybe some others
> > They are detected at configure time without specifying -ansi.
> > So option -ansi may screw compilation of C++ sources. The same
> > about defining __POSIX_SOURCE__
> 
> I don't see the problem: similar trouble happens if someone compiles
> with -ansi a C program which uses non-standard functions.  The only
> difference is that in C++ a missing prototype is an error, not a
> warning.
> 
> Don't other C libraries have the same problem?
> 

I could try something like (untested)

#if defined(__STRICT_ANSI__) || defined(__POSIX_SOURCE__)

namespace std
{
	// prototypes for missing functions
	extern "C" {
		....
	} 
};

#endif

in lang/cvv-v3/djgpp/bits/os_defines.h.

Andris


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019