This is the mail archive of the cygwin 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: negative error status: gcc vs. cl


> -----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/


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