Date: Mon, 31 Jan 2005 10:12:23 -0500 From: David Schultz <das@FreeBSD.ORG> To: Kevin Dorne <sweetpea@tentacle.net> Cc: freebsd-standards@FreeBSD.ORG Subject: Re: g++ & _XOPEN_SOURCE Message-ID: <20050131151223.GA10895@VARK.MIT.EDU> In-Reply-To: <634a43e57953fdc11c0240cc3ae606df@tentacle.net> References: <634a43e57953fdc11c0240cc3ae606df@tentacle.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 01, 2005, Kevin Dorne wrote: > I have been working on getting lurker (http://lurker.sourceforge.net) > to compile on FreeBSD. I managed to do it by removing all #define > _XOPEN_SOURCE 500 from the source files, but the application's author > suggested that such behaviour signified a major bug in libc/c++. > > For example, compiling just this file > > #define _XOPEN_SOURCE 500 > #include <string> > > Gave me this error: > In file included from /usr/include/c++/3.4/bits/postypes.h:46, > from /usr/include/c++/3.4/iosfwd:50, > from /usr/include/c++/3.4/bits/stl_algobase.h:70, > from /usr/include/c++/3.4/bits/char_traits.h:46, > from /usr/include/c++/3.4/string:47, > from xx.cpp:2: > /usr/include/c++/3.4/cwchar:166: error: `::vfwscanf' has not been > declared > /usr/include/c++/3.4/cwchar:170: error: `::vswscanf' has not been > declared > /usr/include/c++/3.4/cwchar:174: error: `::vwscanf' has not been > declared > /usr/include/c++/3.4/cwchar:191: error: `::wcstof' has not been declared > > Is this a bug or a feature? Setting _XOPEN_SOURCE to 500 instructs libc that you want *only* the routines specified in SUSv2, so more recent ones like vfwscanf() (from C99) will not be declared. However, libstdc++ sometimes assumes that the default symbols are available, and hence the error. Perhaps you should report this as a GNU libstdc++ bug. A while ago, Loren was working on fixing this on the libstdc++ end, so I'm Cc'ing him on this. Loren, is there something we could define in wchar.h that would make this easier to fix? Presently, we have: #if __ISO_C_VISIBLE >= 1999 int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, __va_list); [...] #endif /* __ISO_C_VISIBLE >= 1999 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050131151223.GA10895>