Re: negative error status: gcc vs. cl

2004-07-09 Thread Daniel Lungu
-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

Re: negative error status: gcc vs. cl

2004-07-09 Thread Christopher Faylor
On Fri, Jul 09, 2004 at 11:24:04AM +0200, Daniel Lungu wrote: -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

FYI: negative error status: gcc vs. cl

2004-07-09 Thread Daniel Lungu
Igor could be right about (status = 0x), just in case is not masked by _exit() as for msvcrt exit() % cat err.c #include stdlib.h int main(int argc, char **argv) { if (argc == 1) return (0); exit(strtol(argv[1], NULL, 16)); } - b31 = b16 = 0 - % err-cl 0x7ffeff5a ;

Re: negative error status: gcc vs. cl

2004-07-08 Thread Corinna Vinschen
On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe The answer is don't do that. Use positive values in the range from 0 to 255. See http://www.opengroup.org/onlinepubs/009695399/functions/exit.html Corinna -- Corinna

Re: negative error status: gcc vs. cl

2004-07-08 Thread Daniel Lungu
Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe :) The answer is don't do that. Use positive values in the range from :) 0 to 255. See :) http://www.opengroup.org/onlinepubs/009695399/functions/exit.html I wouldn't do that. The problem is other did it

RE: negative error status: gcc vs. cl

2004-07-08 Thread Dave Korn
-Original Message- From: cygwin-owner On Behalf Of Corinna Vinschen Sent: 08 July 2004 11:09 On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe The answer is don't do that. Use positive values in the

Re: negative error status: gcc vs. cl

2004-07-08 Thread Corinna Vinschen
On Jul 8 14:00, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe :) The answer is don't do that. Use positive values in the range from :) 0 to 255. See :) http://www.opengroup.org/onlinepubs/009695399/functions/exit.html I

Re: negative error status: gcc vs. cl

2004-07-08 Thread Igor Pechtchanski
On Thu, 8 Jul 2004, Corinna Vinschen wrote: On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe The answer is don't do that. Use positive values in the range from 0 to 255. See

Re: negative error status: gcc vs. cl

2004-07-08 Thread Christopher Faylor
On Thu, Jul 08, 2004 at 10:25:09AM -0400, Igor Pechtchanski wrote: On Thu, 8 Jul 2004, Corinna Vinschen wrote: On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe The answer is don't do that. Use positive values in

Re: negative error status: gcc vs. cl

2004-07-08 Thread Igor Pechtchanski
On Thu, 8 Jul 2004, Christopher Faylor wrote: On Thu, Jul 08, 2004 at 10:25:09AM -0400, Igor Pechtchanski wrote: On Thu, 8 Jul 2004, Corinna Vinschen wrote: On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on Cygwin mess up with negative exit status from a cl compiled .exe

Re: negative error status: gcc vs. cl

2004-07-08 Thread Daniel Lungu
:) The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any :) other value :) but what you shouldn't do is expect the exit status in the shell to be :) anything other than the least-significant byte of the value you passed: :) though only the least significant 8 bits (that is,

RE: negative error status: gcc vs. cl

2004-07-08 Thread Dave \I do not speak for ATT!\ Korn
-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;

Re: negative error status: gcc vs. cl

2004-07-08 Thread Christopher Faylor
On Thu, Jul 08, 2004 at 11:23:41AM -0400, Igor Pechtchanski wrote: On Thu, 8 Jul 2004, Christopher Faylor wrote: On Thu, Jul 08, 2004 at 10:25:09AM -0400, Igor Pechtchanski wrote: On Thu, 8 Jul 2004, Corinna Vinschen wrote: On Jul 8 11:49, Daniel Lungu wrote: Feel like bash tcsh on