GPA 0.7.0 released

Miguel Coca mcoca at gnu.org
Wed Oct 22 20:35:44 CEST 2003


On Wed, Oct 22, 2003 at 17:32:18 +0100, Steve Kennedy wrote:
> On Wed, Oct 22, 2003 at 06:19:11PM +0200, Miguel Coca wrote:
> 
> > Strange. Your compiler doesn't complain about include getopt.h, but
> > doesn't seem to have "struct option". That's standard according to
> > POSIX, so I don't see what could be wrong. Look for the declaration of
> > "struct option" in your headers, maybe we can find out what's going
> > on.
> > GPA does use a non standard getopt extension, getopt_long(). In
> > Solaris, that function is available in libiberty. No idea whether that
> > will work with compilers other than gcc, though.
> 
> I dont think it does :(

I think it should, if you tinker around with it a bit.

> Non portable code ...

As a quick and dirty fix, remove the longopts variable, and change
the call to getopt_long to getopt, replacing:

  while ((optc = getopt_long (argc, argv, "hvo:kf", longopts, (int *) 0)) != EOF)

With:

  while ((optc = getopt (argc, argv, "hvo:kf" )) != EOF)

That should work if you can't get getopt_long for your system.

(For the record, I was wrong about "struct option" being standard. I
didn't realize getopt() didn't receive a "struct option" parameter)

Thanks,
-- 
Miguel Coca (mcoca at gnu.org)                http://zipi.fi.upm.es/~e970095/
       OpenPGP: E60A CBF4 5C6F 914E B6C1  C402 8C4D C7B6 27FC 3CA8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : /pipermail/attachments/20031022/29101e92/attachment.bin


More information about the Gpa-dev mailing list