Guest User

Untitled

a guest
Jul 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. luis@seyori:~/sandbox$ cat test.c
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int i;
  7. i++;
  8. int j = i + 2;
  9.  
  10. return 0;
  11. }
  12. luis@seyori:~/sandbox$ gcc --version
  13. i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
  14. Copyright (C) 2007 Free Software Foundation, Inc.
  15. This is free software; see the source for copying conditions. There is NO
  16. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17.  
  18. luis@seyori:~/sandbox$ gcc -Werror=declaration-after-statement test.c
  19. test.c: In function ‘main’:
  20. test.c:7: warning: ISO C90 forbids mixed declarations and code
  21. luis@seyori:~/sandbox$ echo $?
  22. 0
  23. luis@seyori:~/sandbox$ gcc -Wdeclaration-after-statement test.c
  24. test.c: In function ‘main’:
  25. test.c:7: warning: ISO C90 forbids mixed declarations and code
  26. luis@seyori:~/sandbox$ echo $?
  27. 0
  28. luis@seyori:~/sandbox$ i686-w64-mingw32-gcc --version
  29. i686-w64-mingw32-gcc (GCC) 4.5.2 20101018 (prerelease)
  30. Copyright (C) 2010 Free Software Foundation, Inc.
  31. This is free software; see the source for copying conditions. There is NO
  32. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  33.  
  34. luis@seyori:~/sandbox$ i686-w64-mingw32-gcc -Werror=declaration-after-statement test.c
  35. test.c: In function ‘main’:
  36. test.c:7:3: error: ISO C90 forbids mixed declarations and code
  37. luis@seyori:~/sandbox$ echo $?
  38. 1
  39. luis@seyori:~/sandbox$ i686-w64-mingw32-gcc -Wdeclaration-after-statement test.c
  40. test.c: In function ‘main’:
  41. test.c:7:3: warning: ISO C90 forbids mixed declarations and code
  42. luis@seyori:~/sandbox$ echo $?
  43. 0
  44. luis@seyori:~/sandbox$
Add Comment
Please, Sign In to add comment