|
4744 | 4744 | # We want to suppress clang's unhelpful unused-command-line-argument warnings
|
4745 | 4745 | # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
|
4746 | 4746 | # test for the positive form and if that works, add the negative form
|
| 4747 | + NOT_THE_CFLAGS="" |
4747 | 4748 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
|
4748 | 4749 | $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
|
4749 | 4750 | if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
|
@@ -4782,6 +4783,85 @@ fi
|
4782 | 4783 | if test -n "$NOT_THE_CFLAGS"; then
|
4783 | 4784 | CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
|
4784 | 4785 | fi
|
| 4786 | + # Similarly disable useless truncation warnings from gcc 8+ |
| 4787 | + NOT_THE_CFLAGS="" |
| 4788 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-truncation" >&5 |
| 4789 | +$as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; } |
| 4790 | +if ${pgac_cv_prog_cc_cflags__Wformat_truncation+:} false; then : |
| 4791 | + $as_echo_n "(cached) " >&6 |
| 4792 | +else |
| 4793 | + pgac_save_CFLAGS=$CFLAGS |
| 4794 | +CFLAGS="$pgac_save_CFLAGS -Wformat-truncation" |
| 4795 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4796 | +ac_c_werror_flag=yes |
| 4797 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 4798 | +/* end confdefs.h. */ |
| 4799 | +
|
| 4800 | +int |
| 4801 | +main () |
| 4802 | +{ |
| 4803 | +
|
| 4804 | + ; |
| 4805 | + return 0; |
| 4806 | +} |
| 4807 | +_ACEOF |
| 4808 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 4809 | + pgac_cv_prog_cc_cflags__Wformat_truncation=yes |
| 4810 | +else |
| 4811 | + pgac_cv_prog_cc_cflags__Wformat_truncation=no |
| 4812 | +fi |
| 4813 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4814 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4815 | +CFLAGS="$pgac_save_CFLAGS" |
| 4816 | +fi |
| 4817 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_truncation" >&5 |
| 4818 | +$as_echo "$pgac_cv_prog_cc_cflags__Wformat_truncation" >&6; } |
| 4819 | +if test x"$pgac_cv_prog_cc_cflags__Wformat_truncation" = x"yes"; then |
| 4820 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" |
| 4821 | +fi |
| 4822 | + |
| 4823 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4824 | + CFLAGS="$CFLAGS -Wno-format-truncation" |
| 4825 | + fi |
| 4826 | + NOT_THE_CFLAGS="" |
| 4827 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstringop-truncation" >&5 |
| 4828 | +$as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; } |
| 4829 | +if ${pgac_cv_prog_cc_cflags__Wstringop_truncation+:} false; then : |
| 4830 | + $as_echo_n "(cached) " >&6 |
| 4831 | +else |
| 4832 | + pgac_save_CFLAGS=$CFLAGS |
| 4833 | +CFLAGS="$pgac_save_CFLAGS -Wstringop-truncation" |
| 4834 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4835 | +ac_c_werror_flag=yes |
| 4836 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 4837 | +/* end confdefs.h. */ |
| 4838 | +
|
| 4839 | +int |
| 4840 | +main () |
| 4841 | +{ |
| 4842 | +
|
| 4843 | + ; |
| 4844 | + return 0; |
| 4845 | +} |
| 4846 | +_ACEOF |
| 4847 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 4848 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=yes |
| 4849 | +else |
| 4850 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=no |
| 4851 | +fi |
| 4852 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4853 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4854 | +CFLAGS="$pgac_save_CFLAGS" |
| 4855 | +fi |
| 4856 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wstringop_truncation" >&5 |
| 4857 | +$as_echo "$pgac_cv_prog_cc_cflags__Wstringop_truncation" >&6; } |
| 4858 | +if test x"$pgac_cv_prog_cc_cflags__Wstringop_truncation" = x"yes"; then |
| 4859 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" |
| 4860 | +fi |
| 4861 | + |
| 4862 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4863 | + CFLAGS="$CFLAGS -Wno-stringop-truncation" |
| 4864 | + fi |
4785 | 4865 | elif test "$ICC" = yes; then
|
4786 | 4866 | # Intel's compiler has a bug/misoptimization in checking for
|
4787 | 4867 | # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
|
|
0 commit comments