Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2001 04:17:35 -0500
From:      Mike Barcroft <mike@FreeBSD.org>
To:        Wes Peters <wes@softweyr.com>
Cc:        Bruce Evans <bde@FreeBSD.org>, standards@FreeBSD.org
Subject:   Re: cvs commit: src/include string.h
Message-ID:  <20011129041735.F15672@espresso.q9media.com>
In-Reply-To: <3C05F40D.15370F5A@softweyr.com>; from wes@softweyr.com on Thu, Nov 29, 2001 at 01:38:37AM -0700
References:  <200111281902.fASJ21x89181@freefall.freebsd.org> <3C05F40D.15370F5A@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[Wes Peters asked a question about Bruce's recent commit to <string.h>
in a private e-mail.  The question basicly asked why Bruce moved it
into the somewhat miscorrectly labeled "Nonstandard routines" section.
I thought my reply would be useful to a larger audience.]


The problem is that we don't want to pollute older environments with
new functions.  For instance, if one specifies that they want to
compile using an older POSIX or C standard, the system can't pollute
the namespace with functions that comply with newer standards.

As Bruce's commit message suggests, this is only temporary.  I think
we need something along the lines of:

#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#if _POSIX_C_SOURCE >= 200111L /* XXX */
...
#endif
#endif

...to properly protect new POSIX functions.  Broken down, this means
something like "only prototype this function if we aren't using C90,
POSIX.1, POSIX.1-88, POSIX.1-90, or POSIX.1-96".  I'm unsure whether
we care if POSIX.1-200x functions leak into C99.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011129041735.F15672>