standards/63173: Patch to add getopt_long_only(3) to libc
Andrey Chernov
ache at nagual.pp.ru
Sat Feb 21 10:50:13 PST 2004
The following reply was made to PR standards/63173; it has been noted by GNATS.
From: Andrey Chernov <ache at nagual.pp.ru>
To: Marius Strobl <marius at alchemy.franken.de>
Cc: FreeBSD-gnats-submit at FreeBSD.ORG, ru at FreeBSD.ORG
Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc
Date: Sat, 21 Feb 2004 21:48:14 +0300
On Sat, Feb 21, 2004 at 04:57:06PM +0100, Marius Strobl wrote:
> after applying the patch still doesn't implement getopt(3) and
> therefore replace src/lib/libc/stdlib/getopt.c, i.e. it doesn't
> define REPLACE_GETOPT, yet. This is something that should be taken
> into consideration for FreeBSD 6 (regardless if the patch is applied
> or not).
Please always consider POSIX as superceeded standard against GNU/Linux.
It means your patch for header is wrong. If POSIX says that getopt() must
be declared in <unistd.h>, it is only place where is must be declared, and
not in <getopt.h> etc. If you need its declaration in non-standard header
<getopt.h>, <unistd.h> must be included, as was done before your patch.
Also please remove all getopt()-related redeclarations from <getopt.h>
Forget about REPLACE_GETOPT, it will never be defined, we already have
standard-conforming one. Making getopt() like getopt_long() really breaks
some strict getopt() syntax. If some GNU program likes to use plain
getopt() as getopt_long(), it should either use separate library or it
source code should replace getopt->getopt_long.
Otherwise it looks fine.
--
Andrey Chernov | http://ache.pp.ru/
More information about the freebsd-standards
mailing list