This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: need to define _ISOC99_SOURCE


   From: Ulrich Drepper <drepper@redhat.com>
   Date: 26 Jul 2000 09:22:24 -0700

   if you are using functionality from a certain
   standard you must define the appropriate feature selection macro.
   Otherwise the system is allowed to do anything.

True, but please make as many symbols visible as possible by default.
This is the most useful for GNU applications.  For example, symbols
like getlogin_r and tmpnam_r should be visible if I use plain "gcc"
without defining any feature-test macros.

POSIX says that a program must define _POSIX_C_SOURCE to get a
POSIX-conforming environment.  The idea is to allow a POSIX-compliant
application to declare its own unrelated tmpnam_r function without
worrying about whether this collides with the implementation's
function.

However, this idea is rarely used in practice by GNU applications,
because on most platforms defining _POSIX_C_SOURCE turns off
extensions, and this hurts functionality.  Instead, GNU applications
use autoconf to find out what functions are available.  GNU
applications don't want to be limited to using only the POSIX
functions; they want to run well on their target host, and exploit its
extra features.  The GNU C library should support this.

It might be useful to have a pedantic mode (enabled by defining
__PEDANTIC, say?), where glibc declares only the symbols that it is
required to define.  This might help to check for some kinds of
portability problems.  However, pedantic mode should not be the
default, as it gets in the way of autoconfiguring GNU applications.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]