This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin 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: which getopt.c is cygwin1.dll using?


Distantly related to this is a problem that I had recently. I wanted to
compile pdksh-5.2.14 for cygwin. The only problem I have was a namespace
conflict with getopt.h. Its seems that pdksh define a struct called "struct
option" in the source, this is also defined in getopt.h this wouldnt have
been a problem becuase pdksh doesnt use getopt for command line parsing, but
it does include <unistd.h>, after looking at the definition of <unistd.h> I
noticed that under cygwin <unistd.h> include <getopt.h>. According to the
POSIX spec <unistd.h> is not supposed to include <getopt.h>, as a work
around I redifed the local variable to "struct option_local"..... thought I
would bring it up hopefully a develope can comment on whey cygwin does this?


Nathan Downey

-----Original Message-----
From: Christopher Faylor [mailto:cgf@redhat.com]
Sent: Wednesday, November 28, 2001 5:20 PM
To: cygwin@cygwin.com
Subject: Re: which getopt.c is cygwin1.dll using?


On Wed, Nov 28, 2001 at 02:25:19PM -0700, Mark Paulus wrote:
>I just pulled the source for cygwin-1.3.5-3 and see that there are 3
>different copies/versions of getopt.c, 1 of getopt1.c and a
>getoptlong.c So, when I do a getopt in my piece of code, which
>copy/flavour/version of getopt am I going to invoke??

Why not apply Occam's razor to the problem?

There's a getopt.c in a directory called 'libiberty'.
There's a getopt.c in a directory called 'newlib'.
And, there's a getopt.c in a directory called 'cygwin'.

Now, which of the above would you assume would be incorporated into
cygwin1.dll?

Or, you could even look in the Makefile if this kind of analysis makes
no sense.

>I need to track down an issue, but I would like to get it done while I
>am still a relatively young man....

Next step will be to figure out whether to use vim or vi, I suppose.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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