diff options
| author | Dan Nicolaescu | 2009-11-20 06:05:10 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-11-20 06:05:10 +0000 |
| commit | 7a2efa6f088dee91feb2c095f81cf9c2030c2e97 (patch) | |
| tree | 1ab2d0dd5239c29fa3eea17b13187badeb850be0 | |
| parent | 9717f1199f337920aeeb66417233c28d5f978f79 (diff) | |
| download | emacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.tar.gz emacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.zip | |
Use -Wdeclaration-after-statement if available.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rwxr-xr-x | configure | 56 | ||||
| -rw-r--r-- | configure.in | 13 |
3 files changed, 73 insertions, 0 deletions
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-11-20 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * configure.in: Use -Wdeclaration-after-statement if available. | ||
| 4 | |||
| 1 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> | 5 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 6 | ||
| 3 | * configure.in: New option: --with(out)-gconf. | 7 | * configure.in: New option: --with(out)-gconf. |
| @@ -4896,6 +4896,62 @@ CFLAGS="$SAVE_CFLAGS" | |||
| 4896 | unset has_option | 4896 | unset has_option |
| 4897 | unset SAVE_CFLAGS | 4897 | unset SAVE_CFLAGS |
| 4898 | 4898 | ||
| 4899 | ### Use -Wdeclaration-after-statement if the compiler supports it | ||
| 4900 | { $as_echo "$as_me:$LINENO: checking whether gcc understands -Wdeclaration-after-statement" >&5 | ||
| 4901 | $as_echo_n "checking whether gcc understands -Wdeclaration-after-statement... " >&6; } | ||
| 4902 | SAVE_CFLAGS="$CFLAGS" | ||
| 4903 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" | ||
| 4904 | cat >conftest.$ac_ext <<_ACEOF | ||
| 4905 | /* confdefs.h. */ | ||
| 4906 | _ACEOF | ||
| 4907 | cat confdefs.h >>conftest.$ac_ext | ||
| 4908 | cat >>conftest.$ac_ext <<_ACEOF | ||
| 4909 | /* end confdefs.h. */ | ||
| 4910 | |||
| 4911 | int | ||
| 4912 | main () | ||
| 4913 | { | ||
| 4914 | |||
| 4915 | ; | ||
| 4916 | return 0; | ||
| 4917 | } | ||
| 4918 | _ACEOF | ||
| 4919 | rm -f conftest.$ac_objext | ||
| 4920 | if { (ac_try="$ac_compile" | ||
| 4921 | case "(($ac_try" in | ||
| 4922 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | ||
| 4923 | *) ac_try_echo=$ac_try;; | ||
| 4924 | esac | ||
| 4925 | eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" | ||
| 4926 | $as_echo "$ac_try_echo") >&5 | ||
| 4927 | (eval "$ac_compile") 2>conftest.er1 | ||
| 4928 | ac_status=$? | ||
| 4929 | grep -v '^ *+' conftest.er1 >conftest.err | ||
| 4930 | rm -f conftest.er1 | ||
| 4931 | cat conftest.err >&5 | ||
| 4932 | $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
| 4933 | (exit $ac_status); } && { | ||
| 4934 | test -z "$ac_c_werror_flag" || | ||
| 4935 | test ! -s conftest.err | ||
| 4936 | } && test -s conftest.$ac_objext; then | ||
| 4937 | has_option=yes | ||
| 4938 | else | ||
| 4939 | $as_echo "$as_me: failed program was:" >&5 | ||
| 4940 | sed 's/^/| /' conftest.$ac_ext >&5 | ||
| 4941 | |||
| 4942 | has_option=no | ||
| 4943 | fi | ||
| 4944 | |||
| 4945 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||
| 4946 | if test $has_option = yes; then | ||
| 4947 | C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" | ||
| 4948 | fi | ||
| 4949 | { $as_echo "$as_me:$LINENO: result: $has_option" >&5 | ||
| 4950 | $as_echo "$has_option" >&6; } | ||
| 4951 | CFLAGS="$SAVE_CFLAGS" | ||
| 4952 | unset has_option | ||
| 4953 | unset SAVE_CFLAGS | ||
| 4954 | |||
| 4899 | #### Some other nice autoconf tests. | 4955 | #### Some other nice autoconf tests. |
| 4900 | 4956 | ||
| 4901 | { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 | 4957 | { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 |
diff --git a/configure.in b/configure.in index d469cb13d44..a4abbe04d29 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -757,6 +757,19 @@ CFLAGS="$SAVE_CFLAGS" | |||
| 757 | unset has_option | 757 | unset has_option |
| 758 | unset SAVE_CFLAGS | 758 | unset SAVE_CFLAGS |
| 759 | 759 | ||
| 760 | ### Use -Wdeclaration-after-statement if the compiler supports it | ||
| 761 | AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement]) | ||
| 762 | SAVE_CFLAGS="$CFLAGS" | ||
| 763 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" | ||
| 764 | AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) | ||
| 765 | if test $has_option = yes; then | ||
| 766 | C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" | ||
| 767 | fi | ||
| 768 | AC_MSG_RESULT($has_option) | ||
| 769 | CFLAGS="$SAVE_CFLAGS" | ||
| 770 | unset has_option | ||
| 771 | unset SAVE_CFLAGS | ||
| 772 | |||
| 760 | #### Some other nice autoconf tests. | 773 | #### Some other nice autoconf tests. |
| 761 | 774 | ||
| 762 | dnl checks for programs | 775 | dnl checks for programs |