GCC 3.0.3 build-procedure incompatibilities with POSIX 1003.1-2001

Paul Eggert eggert@twinsun.com
Tue Feb 19 14:26:00 GMT 2002


> Date: Tue, 19 Feb 2002 11:22:36 -0800
> From: Zack Weinberg <zack@codesourcery.com>
> 
> > GNU diff is one of the affected utilities.  If you run it in
> > POSIX 2001 mode...
> 
> In that case, one hopes that POSIX 2001 mode is enabled only by
> explicit user option

POSIX 2001 mode is enabled by setting _POSIX2_VERSION=200112 in the
environment.  The default value of _POSIX2_VERSION is set by the host
operating system, in <unistd.h>.  All operating systems that I know of
right now set _POSIX2_VERSION to 199209L (or don't set it at all), so
you should be OK with current systems.  Some time in the next few
months when you run into an operating system that sets _POSIX2_VERSION
to 200112L you can work around the problem by setting
_POSIX2_VERSION=199209 in your environment, assuming you're using the
GNU utilities rather than the native utilities.


> I'm disturbed to see uniq dropped from POSIX

It wasn't dropped; only the usage "uniq -NUMBER" was dropped.  You're
supposed to use "uniq -f NUMBER" now.  The -f option was not in Unix
Version 7, though, so if you want to be portable back to 1978 you're
stuck.  Personally, though, I never really trusted "uniq -NUMBER" in
portable code, even before POSIX 1003.2-1992 deprecated it.

The particular case of ltmain.sh does not need uniq at all, so it was
easy enough to sidestep the portability issue entirely there.



More information about the Gcc-bugs mailing list