This is the mail archive of the
cygwin
mailing list for the Cygwin project.
negative error status: gcc vs. cl
- From: Daniel Lungu <lungu at nagra dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 8 Jul 2004 11:49:20 +0200 (W. Europe Daylight Time)
- Subject: negative error status: gcc vs. cl
Feel like bash tcsh on Cygwin mess up with negative exit status from a cl
compiled .exe
% uname -a
CYGWIN_NT-5.0 pc 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown Cygwin
% echo $SHELL
/bin/bash
% cat nerr.c
int main()
{
exit (-2);
}
% gcc -o nerr-gcc nerr.c
% cl -o nerr-cl nerr.c
Micro$oft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Micro$oft Corp 1984-1998. All rights reserved.
nerr.c
Micro$oft (R) Incremental Linker Version 6.00.8168
Copyright (C) Micro$oft Corp 1992-1998. All rights reserved.
/out:nerr.exe
/out:nerr-cl.exe
nerr.obj
-----unsigned-8b-exit-status-----
% nerr-gcc.exe; echo $?
254
-----wrong-nil(!)-exit-status-----
% nerr-cl.exe; echo $?
0
> ver
Microsoft Windows 2000 [Version 5.00.2195]
-----unsigned-16b-exit-status-----
> nerr-gcc.exe
> echo %ERRORLEVEL%
65534
-----signed-exit-status-----
> nerr-cl.exe
> echo %ERRORLEVEL%
-2
Positive exit status works fine from gcc and cl.
Thanks for any feedback.
--
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/