3 ms·
There's no casting involved in while(1). 1 is "true" in C, in fact, any integer != 0 is "true". I just did a quick check and gcc -S produces the same ASM outpu
by tsahyt 14y ago
There's no casting involved in while(1). 1 is "true" in C, in fact, any integer != 0 is "true".
I just did a quick check and gcc -S produces the same ASM output for both of them, which doesn't include any comparisons whatsoever, just a jmp. So both of them are really compiled to an actual infinite loop.