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

Bug#171851: More missing math.h prototypes



On Mon, Dec 30, 2002 at 12:37:59PM -0500, H. S. Teoh wrote:
> On Mon, Dec 30, 2002 at 11:21:37AM -0500, Daniel Jacobowitz wrote:
> > On Mon, Dec 30, 2002 at 11:19:32AM -0500, H. S. Teoh wrote:
> [snip]
> > > Aha. That explains it. So these functions are only defined for ISO C99?
> > 
> > Yes.  Declaring something named "round" when it isn't part of the
> > relevant language standard is a bit much, don't you think? :)
> 
> What is the "relevant language standard"? (By which I assume you're
> talking about the default standard used when you don't define any of these
> _XXX_SOURCE macros.) From a cursory glance at various manpages, there
> seems to be multiple versions of ISO 9899, and presumably C99 is a later
> draft? It seems to be that the "default" behaviour of gcc (or more
> precisely, the header files) should be to use a later standard, but of
> course, that is just my not-very-well-informed opinion.

GCC documents which language it implements for given options; see -std
in the man page.  It doesn't define the necessary glib support macros
automatically but they're tied to the same sets of standards.  The
default is still "gnu89", which is c89 with GNU extensions.

> [snip]
> > > Is this indicated in the docs, though? As far as I can tell, the info
> > > pages do not indicate that C99 mode is needed to use these functions.
> > 
> > Hmm, I don't see it either.
> 
> The manpages do indicate clearly which functions belong to which
> standard(s), although it isn't always obvious that you need to
> specifically define _ISOC99_SOURCE. Perhaps I should glean this info from
> the manpages and submit a patch for glibc-doc?

That might be a good idea.  Such patches should be CC'd to
libc-alpha@sources.redhat.com.

> 
> [snip]
> > > Anyway, this bug now looks like a documentation bug/deficiency. The
> > > manpages should add #define _ISO_SOURCE (or whatever the proper name was,
> > > I forgot) for these functions, and the info pages should indicate the C99
> > > prerequisite as well.
> > 
> > Either -D_GNU_SOURCE or -D_ISOC99_SOURCE (or _ISOC9X_SOURCE or
> > __STDC_VERSION__=199901L).
> [snip]
> 
> Thanks, I'll keep that in mind when patching glibc-doc. (Although I
> probably should leave out _GNU_SOURCE, since that is non-standard? :-P)

I think you just need to specify the standard, not the macros; the
mapping is already there, in "Feature Test Macros".

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: