On Wed, Sep 26, 2001 at 10:59:12PM +1000, Hamish Moffatt wrote: > This is a pretty funky bug. I've been experimenting with it, as I have > an hppa machine of my own. I have all the latest sid updates installed. > > The difference seems to be g++ 3.0 on hppa. You can replicate it on > i386 (etc) with g++-3.0 too.
Interesting...I thought that I had tried it with g++-3.0 on i386 as well, but I can confirm that it doesn't work now. I've reassigned the bug to g++-3.0. > If I do > > g++ -E -c -D_BSD_SOURCE /usr/include/netinet/udp.h > > then I can see the BSD definitions (uh_sport etc), both on i386 and hppa. > But if I do > > g++-3.0 -E -c udphdrtest.c > > then I see the non-BSD definition on both. Works ok with g++ 2.95.4 on > i386, but hppa doesn't have g* 2.x. > > Looking at the output of g++{,-3.0} -c -E -dM, version 3 fails > to define __FAVOR_BSD, which the header file uses to choose the > definition. <features.h> only #defines __FAVOR_BSD if _GNU_SOURCE > is undefined; on g++ 3.0, _GNU_SOURCE is defined. > > touch blah.c > g++ -c -E -dM blah.c shows no _GNU_SOURCE; > g++-3.0 -c -E -dM blash.c shows _GNU_SOURCE, hence no __FAVOR_BSD > > I'm not sure if there is a bug in the library or not (I can't work out > where _GNU_SOURCE is being defined; it's only with g++-3.0, not with > gcc-3.0, too). You could #undef _GNU_SOURCE in your source though; > that might be a hack. Thanks for the analysis. I can't find anyplace where _GNU_SOURCE is defined, even conditionally, in /usr/include or /usr/lib/gcc-lib. It isn't defined by cpp (cpp -dM /dev/null doesn't show it). Hopefully the GCC maintainers will have some ideas. -- - mdz