Date: Thu, 22 Nov 2001 08:39:30 +0200 (WET) From: Andris Pavenis X-Sender: pavenis AT ieva06 To: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On Wed, 21 Nov 2001, Eli Zaretskii wrote: > > Date: Wed, 21 Nov 2001 18:42:03 +0200 (WET) > > From: Andris Pavenis > > > > 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