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]

FYI: negative error status: gcc vs. cl


Igor could be right about (status &= 0xffff), 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 ; printf "%x\n" $?
5a

----- b16 = 1 -----
% err-cl 0x7ff1ff5a ; printf "%x\n" $?
0

----- b31 = 1 -----
% err-cl 0x8ffeff5a ; printf "%x\n" $?
0

----- havoc with b16 = 1 -----

% err-cl 0x0001105a ; printf "%x\n" $?
Urgent condition on I/O channel
90

% err-cl 0x0001205a ; printf "%x\n" $?
Signal 32
a0

% err-cl 0x0001405a ; printf "%x\n" $?
Signal 64
c0

% err-cl 0x0001305a ; printf "%x\n" $?
Signal 48
b0

% err-cl 0x0001505a ; printf "%x\n" $?
d0

--daniel


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