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]
Other format: [Raw text]

Re: [PATCH] getopt,argp - reentrant getopt interface, argp fixes


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marcus Brinkmann wrote:

> I got a hint that the internal interfaces in posix/getopt.h are not
> desired.

Don't move the declarations into include/getopt.h.  Instead create a new
internal header, getopt_int.h or whatever named.  Move all the internal
stuff in there.  This means users outside glibc will have to copy along
another file but that cannot be a problem.

The patch itself is botch.  What is

- --- libc-old/posix/Versions     2004-03-06 21:10:17.000000000 +0100
+++ libc/posix/Versions 2004-03-08 02:47:28.000000000 +0100
@@ -125,7 +125,5 @@ libc {
     __libc_wait; __libc_waitpid; __libc_pause; __libc_nanosleep;
__libc_fork;
     __libc_pread; __libc_pread64; __libc_pwrite; __libc_pwrite64;
     __waitid; __pselect;
- -    # used by argp
- -    __getopt_long_r; __getopt_long_only_r;
   }

supposed to mean?  There never were such entries.


There should be no need for the global __getopt_initialized variable.
Just always use the value in the struct.  This variable has always been
internal.  Also, in _getopt_internal() there should be no need to copy
the variables going into the function.  Check the code all paths whether
any of the values is being read.  I might miss something but I think
there are none.  I do not worry about the case where the value in the
global opt* variables gets overwritten with a value from __getopt_data
even though the latter hasn't been written to in the _getopt_internal_r
call.

Aslo, you're using some C99 syntax which probably won't make the gnulib
people happy.  Look for uses of _GETOPT_DATA_INITIALIZER.

- -- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFATBuu2ijCOnn/RHQRArbBAKDDWTG18FZ/5KyNcZjHWkuwOvrHPwCeO8el
FDXw2G3DNT1cU/0oVHmzQAo=
=n5nf
-----END PGP SIGNATURE-----


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