DragonFly users List (threaded) for 2007-04
DragonFly BSD
DragonFly users List (threaded) for 2007-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

vfwscanf() and friends


From: Hasso Tepper <hasso@xxxxxxxxx>
Date: Wed, 11 Apr 2007 12:43:51 +0300

I've found the problem that is probably a bug in libstdc++ headers,
but as other OSes seem to workaround it, I'm not sure how and where
we should fix it.

Small testcase (it's C++, fyi ;):

#define _POSIX_C_SOURCE 199309L
#include <cwchar>
int main() { return 0; }

It doesn't compile in DragonFlyBSD, but compiles in Linux and some
random BSD's I have here. Same problem appears with sources defining
_XOPEN_SOURCE 500 and including cwchar header. Both cases should be
perfectly legal AFAICS.

Looking at headers it seems to me that libstdc++ assumes that if
vfwscanf() and friends are in libc, they are there unconditionally
which isn't the case - they are visible in /usr/include/wchar.h if
source defines _POSIX_C_SOURCE at least 200112 (C99).

So, question - how to fix it and where? In libstdc++? But this will
still cause problems to anyone not using compiler provided by system.
In our /usr/include/wchar.h?


regards,

-- 
Hasso Tepper



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]