On Fri, Jul 26, 2013 at 11:51:43AM +0100, David Chisnall wrote: > On 26 Jul 2013, at 11:26, Tijl Coosemans <t...@coosemans.org> wrote:
> > On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote: > >> On 25 Jul 2013, at 19:19, Tijl Coosemans <t...@coosemans.org> wrote: > >>> This also broke compilation of C code with -D_XOPEN_SOURCE=500. > >> Do you have a test case for this? > > % cc -c test.c -D_XOPEN_SOURCE=500 -Wall -std=gnu89 > > test.c:5:10: warning: implicit declaration of function 'isnan' > > [-Wimplicit-function-declaration] > > return( isnan( d )); > > ^ > > 1 warning generated. > > The isnan function is part of SUSv2: > > http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html > > _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros: > > #define __XSI_VISIBLE 500 > > #define __POSIX_VISIBLE 199506 > > #define __ISO_C_VISIBLE 1990 > So, isnan and isinf should be visible in functions when in > __ISO_C_VISIBLE < 1999 and __XSI_VISIBLE < 600, and __XSI_VISIBLE >= > 500? This is cosmetic, but http://pubs.opengroup.org/onlinepubs/000095399/functions/isnan.html says that isnan() appeared in Issue 3. This is before _XOPEN_SOURCE == 500. A simple solution is to expose it when __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999. However, <sys/cdefs.h> has no support for _XOPEN_SOURCE < 500 and there is no point in adding such support now. -- Jilles Tjoelker _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"