Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- luis@seyori:~/sandbox$ cat test.c
- #include <stdio.h>
- int main()
- {
- int i;
- i++;
- int j = i + 2;
- return 0;
- }
- luis@seyori:~/sandbox$ gcc --version
- i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
- Copyright (C) 2007 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- luis@seyori:~/sandbox$ gcc -Werror=declaration-after-statement test.c
- test.c: In function ‘main’:
- test.c:7: warning: ISO C90 forbids mixed declarations and code
- luis@seyori:~/sandbox$ echo $?
- 0
- luis@seyori:~/sandbox$ gcc -Wdeclaration-after-statement test.c
- test.c: In function ‘main’:
- test.c:7: warning: ISO C90 forbids mixed declarations and code
- luis@seyori:~/sandbox$ echo $?
- 0
- luis@seyori:~/sandbox$ i686-w64-mingw32-gcc --version
- i686-w64-mingw32-gcc (GCC) 4.5.2 20101018 (prerelease)
- Copyright (C) 2010 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- luis@seyori:~/sandbox$ i686-w64-mingw32-gcc -Werror=declaration-after-statement test.c
- test.c: In function ‘main’:
- test.c:7:3: error: ISO C90 forbids mixed declarations and code
- luis@seyori:~/sandbox$ echo $?
- 1
- luis@seyori:~/sandbox$ i686-w64-mingw32-gcc -Wdeclaration-after-statement test.c
- test.c: In function ‘main’:
- test.c:7:3: warning: ISO C90 forbids mixed declarations and code
- luis@seyori:~/sandbox$ echo $?
- 0
- luis@seyori:~/sandbox$
Add Comment
Please, Sign In to add comment