delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
From: | "Dave \"I do not speak for AT&T!\" Korn" <dk AT artimi DOT com> |
To: | <cygwin AT cygwin DOT com> |
Subject: | RE: negative error status: gcc vs. cl |
Date: | Thu, 8 Jul 2004 18:25:09 +0100 |
MIME-Version: | 1.0 |
In-Reply-To: | <Pine.WNT.4.21.0407081839590.215-100000@pc0197.hq.k.grp> |
Message-ID: | <NUTMEG6HixqDCZx4FR00000077e@NUTMEG.CAM.ARTIMI.COM> |
X-OriginalArrivalTime: | 08 Jul 2004 17:25:09.0625 (UTC) FILETIME=[84DE2690:01C46510] |
> -----Original Message----- > From: cygwin-owner On Behalf Of Daniel Lungu > Sent: 08 July 2004 18:14 > Indeed, but same arithmetic should apply when exit status > comes from a "cl > compiled .exe". It is not the case when compiling nerr.c with cl: > > -----wrong-nil(!)-exit-status----- > % nerr-cl.exe; echo $? > 0 > > $? cannot distinguish exit(0) from exit(-2) ... this is > logical anarchy! Ah, but those aren't just two different values passed to exit, they are in fact two entirely different versions of the exit function: gcc links in the version from newlib, whereas msvc links in the version from msvcrt. So the problem really is that the Windoze version of the exit function isn't POSIX compliant. Still, we already knew that windoze != unix. That's why cygwin exists, after all! > One cannot reliably test exit status of legacy windoze binaries. Name one platform that *can* reliably test the exit status of binaries that were written for a different platform? It's an achievement that it can even run them. I think if you try and run windoze binaries on Linux or Solaris, that you also won't be able to test the exit code with $? .... > :) cheers, > :) DaveK > > ksh :) yields the same Cygwin bug. Don't blame me! cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |