main() { int a; a=5; printf("%d %d %d\n",a,a++, a++); }
asuresh@parambara:~$ icc m1.c asuresh@parambara:~$ ./a.out 7 5 6 asuresh@parambara:~$ gcc -Wall m1.c m1.c:2:1: warning: return type defaults to ‘int’ [-Wreturn-type] main() ^ m1.c: In function ‘main’: m1.c:6:29: warning: operation on ‘a’ may be undefined [-Wsequence-point] printf("%d %d %d\n",a,a++, a++); ^ m1.c:6:29: warning: operation on ‘a’ may be undefined [-Wsequence-point] m1.c:7:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ asuresh@parambara:~$ ./a.out 7 6 5
(FYI- icc is Intel compiler made by Intel and gcc is GNU compiler)
main() { int a; a=5; printf("%d %d %d\n",a,a++, a++); }
asuresh@parambara:~$ icc m1.c asuresh@parambara:~$ ./a.out 7 5 6 asuresh@parambara:~$ gcc -Wall m1.c m1.c:2:1: warning: return type defaults to ‘int’ [-Wreturn-type] main() ^ m1.c: In function ‘main’: m1.c:6:29: warning: operation on ‘a’ may be undefined [-Wsequence-point] printf("%d %d %d\n",a,a++, a++); ^ m1.c:6:29: warning: operation on ‘a’ may be undefined [-Wsequence-point] m1.c:7:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ asuresh@parambara:~$ ./a.out 7 6 5
(FYI- icc is Intel compiler made by Intel and gcc is GNU compiler)