|
5815 | 5815 | # We want to suppress clang's unhelpful unused-command-line-argument warnings
|
5816 | 5816 | # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
|
5817 | 5817 | # test for the positive form and if that works, add the negative form
|
| 5818 | + NOT_THE_CFLAGS="" |
5818 | 5819 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
|
5819 | 5820 | $as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
|
5820 | 5821 | if ${pgac_cv_prog_CC_cflags__Wunused_command_line_argument+:} false; then :
|
@@ -5857,6 +5858,93 @@ fi
|
5857 | 5858 | if test -n "$NOT_THE_CFLAGS"; then
|
5858 | 5859 | CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
|
5859 | 5860 | fi
|
| 5861 | + # Similarly disable useless truncation warnings from gcc 8+ |
| 5862 | + NOT_THE_CFLAGS="" |
| 5863 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5 |
| 5864 | +$as_echo_n "checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; } |
| 5865 | +if ${pgac_cv_prog_CC_cflags__Wformat_truncation+:} false; then : |
| 5866 | + $as_echo_n "(cached) " >&6 |
| 5867 | +else |
| 5868 | + pgac_save_CFLAGS=$CFLAGS |
| 5869 | +pgac_save_CC=$CC |
| 5870 | +CC=${CC} |
| 5871 | +CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" |
| 5872 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 5873 | +ac_c_werror_flag=yes |
| 5874 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 5875 | +/* end confdefs.h. */ |
| 5876 | + |
| 5877 | +int |
| 5878 | +main () |
| 5879 | +{ |
| 5880 | + |
| 5881 | + ; |
| 5882 | + return 0; |
| 5883 | +} |
| 5884 | +_ACEOF |
| 5885 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 5886 | + pgac_cv_prog_CC_cflags__Wformat_truncation=yes |
| 5887 | +else |
| 5888 | + pgac_cv_prog_CC_cflags__Wformat_truncation=no |
| 5889 | +fi |
| 5890 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 5891 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 5892 | +CFLAGS="$pgac_save_CFLAGS" |
| 5893 | +CC="$pgac_save_CC" |
| 5894 | +fi |
| 5895 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wformat_truncation" >&5 |
| 5896 | +$as_echo "$pgac_cv_prog_CC_cflags__Wformat_truncation" >&6; } |
| 5897 | +if test x"$pgac_cv_prog_CC_cflags__Wformat_truncation" = x"yes"; then |
| 5898 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" |
| 5899 | +fi |
| 5900 | + |
| 5901 | + |
| 5902 | + if test -n "$NOT_THE_CFLAGS"; then |
| 5903 | + CFLAGS="$CFLAGS -Wno-format-truncation" |
| 5904 | + fi |
| 5905 | + NOT_THE_CFLAGS="" |
| 5906 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5 |
| 5907 | +$as_echo_n "checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; } |
| 5908 | +if ${pgac_cv_prog_CC_cflags__Wstringop_truncation+:} false; then : |
| 5909 | + $as_echo_n "(cached) " >&6 |
| 5910 | +else |
| 5911 | + pgac_save_CFLAGS=$CFLAGS |
| 5912 | +pgac_save_CC=$CC |
| 5913 | +CC=${CC} |
| 5914 | +CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" |
| 5915 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 5916 | +ac_c_werror_flag=yes |
| 5917 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 5918 | +/* end confdefs.h. */ |
| 5919 | + |
| 5920 | +int |
| 5921 | +main () |
| 5922 | +{ |
| 5923 | + |
| 5924 | + ; |
| 5925 | + return 0; |
| 5926 | +} |
| 5927 | +_ACEOF |
| 5928 | +if ac_fn_c_try_compile "$LINENO"; then : |
| 5929 | + pgac_cv_prog_CC_cflags__Wstringop_truncation=yes |
| 5930 | +else |
| 5931 | + pgac_cv_prog_CC_cflags__Wstringop_truncation=no |
| 5932 | +fi |
| 5933 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 5934 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 5935 | +CFLAGS="$pgac_save_CFLAGS" |
| 5936 | +CC="$pgac_save_CC" |
| 5937 | +fi |
| 5938 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wstringop_truncation" >&5 |
| 5939 | +$as_echo "$pgac_cv_prog_CC_cflags__Wstringop_truncation" >&6; } |
| 5940 | +if test x"$pgac_cv_prog_CC_cflags__Wstringop_truncation" = x"yes"; then |
| 5941 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" |
| 5942 | +fi |
| 5943 | + |
| 5944 | + |
| 5945 | + if test -n "$NOT_THE_CFLAGS"; then |
| 5946 | + CFLAGS="$CFLAGS -Wno-stringop-truncation" |
| 5947 | + fi |
5860 | 5948 | elif test "$ICC" = yes; then
|
5861 | 5949 | # Intel's compiler has a bug/misoptimization in checking for
|
5862 | 5950 | # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
|
|
0 commit comments