|
4833 | 4833 | # We want to suppress clang's unhelpful unused-command-line-argument warnings
|
4834 | 4834 | # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
|
4835 | 4835 | # test for the positive form and if that works, add the negative form
|
| 4836 | + NOT_THE_CFLAGS="" |
4836 | 4837 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
|
4837 | 4838 | $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
|
4838 | 4839 | if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
|
@@ -4871,6 +4872,85 @@ fi
|
4871 | 4872 | if test -n "$NOT_THE_CFLAGS"; then
|
4872 | 4873 | CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
|
4873 | 4874 | fi
|
| 4875 | + # Similarly disable useless truncation warnings from gcc 8+ |
| 4876 | + NOT_THE_CFLAGS="" |
| 4877 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-truncation" >&5 |
| 4878 | +$as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; } |
| 4879 | +if ${pgac_cv_prog_cc_cflags__Wformat_truncation+:} false; then : |
| 4880 | + $as_echo_n "(cached) " >&6 |
| 4881 | +else |
| 4882 | + pgac_save_CFLAGS=$CFLAGS |
| 4883 | +CFLAGS="$pgac_save_CFLAGS -Wformat-truncation" |
| 4884 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4885 | +ac_c_werror_flag=yes |
| 4886 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 4887 | +/* end confdefs.h. */ |
| 4888 | +
|
| 4889 | +int |
| 4890 | +main () |
| 4891 | +{ |
| 4892 | +
|
| 4893 | + ; |
| 4894 | + return 0; |
| 4895 | +} |
| 4896 | +_ACEOF |
| 4897 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 4898 | + pgac_cv_prog_cc_cflags__Wformat_truncation=yes |
| 4899 | +else |
| 4900 | + pgac_cv_prog_cc_cflags__Wformat_truncation=no |
| 4901 | +fi |
| 4902 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4903 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4904 | +CFLAGS="$pgac_save_CFLAGS" |
| 4905 | +fi |
| 4906 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_truncation" >&5 |
| 4907 | +$as_echo "$pgac_cv_prog_cc_cflags__Wformat_truncation" >&6; } |
| 4908 | +if test x"$pgac_cv_prog_cc_cflags__Wformat_truncation" = x"yes"; then |
| 4909 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" |
| 4910 | +fi |
| 4911 | + |
| 4912 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4913 | + CFLAGS="$CFLAGS -Wno-format-truncation" |
| 4914 | + fi |
| 4915 | + NOT_THE_CFLAGS="" |
| 4916 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstringop-truncation" >&5 |
| 4917 | +$as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; } |
| 4918 | +if ${pgac_cv_prog_cc_cflags__Wstringop_truncation+:} false; then : |
| 4919 | + $as_echo_n "(cached) " >&6 |
| 4920 | +else |
| 4921 | + pgac_save_CFLAGS=$CFLAGS |
| 4922 | +CFLAGS="$pgac_save_CFLAGS -Wstringop-truncation" |
| 4923 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4924 | +ac_c_werror_flag=yes |
| 4925 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 4926 | +/* end confdefs.h. */ |
| 4927 | +
|
| 4928 | +int |
| 4929 | +main () |
| 4930 | +{ |
| 4931 | +
|
| 4932 | + ; |
| 4933 | + return 0; |
| 4934 | +} |
| 4935 | +_ACEOF |
| 4936 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 4937 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=yes |
| 4938 | +else |
| 4939 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=no |
| 4940 | +fi |
| 4941 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4942 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4943 | +CFLAGS="$pgac_save_CFLAGS" |
| 4944 | +fi |
| 4945 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wstringop_truncation" >&5 |
| 4946 | +$as_echo "$pgac_cv_prog_cc_cflags__Wstringop_truncation" >&6; } |
| 4947 | +if test x"$pgac_cv_prog_cc_cflags__Wstringop_truncation" = x"yes"; then |
| 4948 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" |
| 4949 | +fi |
| 4950 | + |
| 4951 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4952 | + CFLAGS="$CFLAGS -Wno-stringop-truncation" |
| 4953 | + fi |
4874 | 4954 | elif test "$ICC" = yes; then
|
4875 | 4955 | # Intel's compiler has a bug/misoptimization in checking for
|
4876 | 4956 | # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
|
|
0 commit comments