The GetCommandLine/WinMain "problem"

Charles Wilson cygwin@cwilson.fastmail.fm
Thu Apr 6 02:53:00 GMT 2006


cgf wrote:
> What we could do is export versions of these in libcygwin.a (not
> necessarily in cygwin1.dll).  A Cygwin version of GetCommandLine[AW]
> would concatenate the contents of __argv and return a string.
> GetEnvironentVariable could do the same thing.

Seems reasonable.

> This is a radical departure from our previously stated goal of "newer
> cygwin's always work" but, frankly, I'm getting very tired of hearing
> how slow cygwin is (read the git mailing list sometime) and I am even
> more tired of making accommodations which slow things down for people
> who are using Cygwin in ways that aren't in line with it's stated goals.

Huh?  ...parse error...

I assume you mean "I am even more tired of making accomodations for 
people who are using Cygwin in ways that aren't in line with it's stated 
goals -- especically when those accomodations slow things down for 
everyone else."

> Does anyone think that requiring people to relink their apps if they
> want to use these Windows-isms is a very bad idea? 

Since WinMain is usually provided by the app (and all the stuff in my 
/usr/bin is stripped so the WinMain symbol is invisible objdump) I 
figured the 'GetCommandLine' import was a useful proxy to look for "bad" 
cygwin programs:

for fn in *.exe ; do \
   (objdump -p $fn | grep GetCommandLine) | sed -e "s/^/${fn}: /"
done

I ran this in my /usr/bin and /usr/X11R6/bin directories -- and I've got 
a fairly comprehensive cygwin installation -- and all I came up with were
   run.exe
   checkX.exe (my new utility in rxvt-unicode-X)
   tclsh[84].exe
   wish[84].exe

cgf, since you maintain the tcl/tk stuff, you've got as big a stake in 
this as ago and I put together...bigger, 'cause run and checkX are tiny 
little utilities.

  I'd like cygwin programs to
> just not worry about the windows command line (or windows environment
> variables) at all.

The only progs who really should care are those that are explicitly 
doing something funky with process creation and console manipulation 
(like run and checkX) or are pretending to be native programs anyway 
(like tclsh and wish).

--
Chuck



More information about the Cygwin-developers mailing list