Re: [Mesa-dev] [PATCH] mesa: Use the proper feature test macros for strtod_l and strtof[_l].

2012-05-11 Thread Bryan Henderson
>Android does not have strtod_l. Yet, the old co de successfully compiled
>because Android does not define _GNU_SOURCE.

Just to make sure we're all on the same page: NOBODY defines _GNU_SOURCE.
At least they shouldn't.  Used correctly, _GNU_SOURCE is something that gets
defined by a #define in the source file which wants to declare itself as
coded for nonstandard GNU features of libc.

And so I have to ask about .  The original code says to include
that if both _GNU_SOURCE and __APPLE__ are defined, which I presume is never.
The current patch says to include it if both __GLIBC__ and __APPLE__ are
defined, which again appears to be never.  I don't know what  is;
who needs it?

-- 
Bryan Henderson   San Jose, California
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Use the proper feature test macros for strtod_l and strtof[_l].

2012-05-12 Thread Bryan Henderson
>Tell that to the config files.  It was added to darwin's config file,
>presumably because we supported the functionality it enabled.

I guess there are a number of things this sentence could mean.  Based on the
juxtaposition of -D_GNU_SOURCE with -D_BSD_SOURCE and -D_DARWIN_C_SOURCE, this
suggests that the Darwin C library responds to _GNU_SOURCE being defined by
providing all those GNU-specific facilities.  Do you know?  Is the Darwin C
library supposed to provide a superset of the GNU C library?

Some people do like to put the definition of these source type declarations on
the compile command (-D) instead of in the source file itself (#define).  I
tend to think it's because they don't understand what the macro is for, but it
could also be because it's more convenient in some ways.

But another reason -D_GNU_SOURCE is in the Darwin config file might be that
someone noticed its incorrect use in strtod.c and exploited it.

Whatever the reason, "if _GNU_SOURCE" evidently cannot just be replaced with
"if __GLIBC__", but has to be "if __GLIBC__ or __APPLE__" and if there are
another other platforms that do -D_GNU_SOURCE but aren't using either the GNU
or Apple C libraries, those have to be added in there too to avoid a
regression.

-- 
Bryan Henderson   San Jose, California
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev