X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,DATE_IN_PAST_06_12,J_CHICKENPOX_33,J_CHICKENPOX_63,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <49AC2ECA.7040709@gmail.com> Date: Mon, 02 Mar 2009 19:08:58 +0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: side effects after installing gcc-3.4.4.999 References: <49AB8757 DOT 90807 AT gmail DOT com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Akakima wrote: > Why "of course" ?. You said in a previous post that the update would go > without change in behaviour. Sorry, I guess it was only implied by my post: the behaviour of *Cygwin* applications hasn't changed. I can't make guarantees about what DOS or Windows will do because that's outside my control. (And I don't think it would make sense to avoid using Linux features in Cygwin just so that stuff will work from DOS!) > I do not want to use gcc-3.exe. > I have many .bat/.cmd files calling gcc and i do not want to modify them. > I still want to be able to call gcc. Wouldn't a good solution be for your windows path to have an extra directory in it ahead of Cygwin's /bin directory, where you could put a windows shortcut to gcc-3.exe and call it "gcc"? That should work; by having this directory at the front of your PATH in DOS (but not in Cygwin) you could easily add overrides for the names of any Cygwin applications/symlinks that you wanted. >>> and now if i type "gcc", cmd finds gcc-3.exe and launch it. >> That didn't work when I tried it: >> >> C:\cygwin\etc\alternatives>gcc >> Access is denied. > > Sorry, i dont know why. I assure you it works on my computer. > The are many entries in the WIndows registry to support shortcuts. > May be one of these entries is not ok on your machine. Yes, or it could just be a version difference. I use win2k on my main system. > the two commands: > gcc > gcc --version > ask for an enter. > > The command: gcc file.c > does generate a.exe without asking for an enter. > I dont know why but will do some more checks. Something very strange is happening! GCC doesn't read any input from stdin in any of those cases, so it's surprising that it behaves differently. > Yes i want to use cmd.exe. This is ok i think. > And i want to type gcc not ggc-3. (lots of .bat files with gcc.exe refs) It's your own choice, of course, but I'd consider modifying the batch files. It might be easier than you think to change them all in one go: find . -name '*.bat' | xargs sed -i -e 's/gcc.exe/gcc-3.exe/g' > cmd.exe does understand links. I just reinstalled the update. > Now, if i type (under cmd.exe): > > E:\cygwin>E:\cygwin\etc\alternatives\gcc.lnk > E:\cygwin>gcc-3: no input files > <--- waiting for an enter here. Enter does gives me the next line. > E:\cygwin> OK, hang on a moment, I know it might sound silly of me to ask but now I have to check: you aren't doing something unusual like running cmd.exe in a rxvt window are you? Or do you by any chance have CYGWIN=tty set in your environment variables? I wonder if it's really "waiting for an enter", or if it's actually waiting for a full command line, and just the prompt hasn't been flushed to the screen yet. What happens if you type "dir " or some other command instead of just pressing enter on its own? In your earlier examples, where I said "Cygwin doesn't read stdin anyway", that's still the case. But there is one difference that might be the reason here: when you run "gcc file.c", gcc launches a number of subprocesses - preprocessor, compiler, assembler, linker. With the other two commands, it runs and exits without launching any other executables; I wonder if somehow that means that in one case all the output gets flushed and you see the prompt and know it's finished, in the other case the prompt gets lost in a buffer somewhere and you don't see it. Maybe launching subprocesses causes all the buffers to be flushed through in the first case. > Now, i am not saying this is a bug in cygwin. Again, i just want to make > someone aware of the fact this is not without change in behaviour. Sorry, yes, we're not always clear about this. Usage from DOS is a nice-to-have feature, but can't always be guaranteed to work the same as usage from within a Cygwin shell. When I said "no change in behaviour", I was only thinking of "within a Cygwin environment"; my apologies for not being as clear as I could have been. > For the moment, i undone the update. Later i will find something else. > (Like copy gcc-3.exe gcc.exe). I would advise you consider my suggestion of having a renaming-and-overriding directory full of windows shortcuts at the head of your PATH. There are quite a lot of things in /bin that exist primarily as symlinks to the real application, gcc is just one among many. > And if i want to use both gcc3 and gcc4, i will probably use a couples > of bat files that will switch things around. That would work nicely with the directory-full-of-shortcuts approach, and basically you'd then have reimplemented in DOS the switching that I've done only within the Cygwin environment. Hey, I just tried that out to see if it works, and it does, but it also allows me to see the "waits for enter" problem occurring! It's definitely just the DOS prompt getting lost somehow; any command that you type before pressing enter does get executed when you do. Ah, look, it's not that the prompt is getting lost: it's just that GCC's output comes out after the prompt for some reason. See the example below: C:\cyg-overrides>gcc C:\cyg-overrides>gcc-3: no input files dir Volume in drive C is SYSTEM Volume Serial Number is D472-11D8 Directory of C:\cyg-overrides 02/03/2009 19:04 . 02/03/2009 19:04 .. 02/03/2009 19:04 443 gcc.lnk 1 File(s) 443 bytes 2 Dir(s) 50,528,649,216 bytes free C:\cyg-overrides> Is that how it's happening for you? cheers, DaveK -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/