Why no warning?
I was expecting a warning for this assignment, but can't get from GCC, why? isn't it an overflow?
char c = 0xff;
.
Relevant Pages
- Re: Why no warning?
... "is char a signed or unsigned type?" ... Note however that "overflow" only makes sense in the context ... I am running the GCC on X86, I am sure by default the char should be signed, and even I add the option -fsigned-char, the result is same. ... overchar.c:1: warning: overflow in implicit constant conversion ... (comp.lang.c) - Re: gcc4 and lvalues
... > I am trying to compile a C program (that used to work fine with gcc 2.x.y, ... On the assignment to s, callocreturns a void* which is implicitly ... converted to char*. ... other compilers weren't catching these errors. ... (comp.std.c) - Re: Integer Overflow
... overflow will be checked only in the last operation of ... after the assignment. ... (comp.lang.c) - Re: Why no warning?
... GCC, why? ... isn't it an overflow? ... char c = 0xff; ... If you want a small variable (typically 8-bit on most architectures) for ... (comp.lang.c) - Re: I beleive that forth could supplant ruby and perl and python if it wanted to
... By feeding different C code to GCC, you can get GCC to produce smaller code ... instructions, i.e., emitting eax instead of al, etc. ... memcopy(char *src, char *dest, int count) ... xorl %edx, %edx ... (comp.lang.forth) |
|