3 ms·
The compilers might be more helpful, too, by displaying hints or even warnings when the clever code is used. This would not forbid it but would encourage for un
by kaitnieks 17y ago
The compilers might be more helpful, too, by displaying hints or even warnings when the clever code is used. This would not forbid it but would encourage for universally cleaner code.
- jacquesm 17y agoSome compilers do that actually, and there are also code inspection tools that will give you warnings about such constructs.
- znull 17y ago$ cat foo.c #include <stdio.h> int main(int ac, char av) { int x = 3; x = x + x++; printf("x = %d\n", x); return 0; } $ make foo CFLAGS=-Wall cc -Wall foo.c -o foo foo.c: In function ‘main’: foo.c:5: warning: operation on ‘x’ may be undefined $ ./foo x = 7