From owner-freebsd-standards@FreeBSD.ORG Mon Jan 31 15:12:07 2005 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C15A16A4CE for ; Mon, 31 Jan 2005 15:12:07 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2163943D31 for ; Mon, 31 Jan 2005 15:12:07 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.13.1) with ESMTP id j0VFCOci011111; Mon, 31 Jan 2005 10:12:24 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.13.1/Submit) id j0VFCNXt011110; Mon, 31 Jan 2005 10:12:23 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 31 Jan 2005 10:12:23 -0500 From: David Schultz To: Kevin Dorne Message-ID: <20050131151223.GA10895@VARK.MIT.EDU> Mail-Followup-To: Kevin Dorne , freebsd-standards@FreeBSD.ORG, rittle@labs.mot.com References: <634a43e57953fdc11c0240cc3ae606df@tentacle.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <634a43e57953fdc11c0240cc3ae606df@tentacle.net> cc: rittle@labs.mot.com cc: freebsd-standards@FreeBSD.ORG Subject: Re: g++ & _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 15:12:07 -0000 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 > > 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 */