|
4508 | 4508 | # We want to suppress clang's unhelpful unused-command-line-argument warnings
|
4509 | 4509 | # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
|
4510 | 4510 | # test for the positive form and if that works, add the negative form
|
| 4511 | + NOT_THE_CFLAGS="" |
4511 | 4512 | { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wunused-command-line-argument" >&5
|
4512 | 4513 | $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
|
4513 | 4514 | if test "${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+set}" = set; then
|
@@ -4571,6 +4572,135 @@ fi
|
4571 | 4572 | if test -n "$NOT_THE_CFLAGS"; then
|
4572 | 4573 | CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
|
4573 | 4574 | fi
|
| 4575 | + # Similarly disable useless truncation warnings from gcc 8+ |
| 4576 | + NOT_THE_CFLAGS="" |
| 4577 | + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wformat-truncation" >&5 |
| 4578 | +$as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; } |
| 4579 | +if test "${pgac_cv_prog_cc_cflags__Wformat_truncation+set}" = set; then |
| 4580 | + $as_echo_n "(cached) " >&6 |
| 4581 | +else |
| 4582 | + pgac_save_CFLAGS=$CFLAGS |
| 4583 | +CFLAGS="$pgac_save_CFLAGS -Wformat-truncation" |
| 4584 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4585 | +ac_c_werror_flag=yes |
| 4586 | +cat >conftest.$ac_ext <<_ACEOF |
| 4587 | +/* confdefs.h. */ |
| 4588 | +_ACEOF |
| 4589 | +cat confdefs.h >>conftest.$ac_ext |
| 4590 | +cat >>conftest.$ac_ext <<_ACEOF |
| 4591 | +/* end confdefs.h. */ |
| 4592 | + |
| 4593 | +int |
| 4594 | +main () |
| 4595 | +{ |
| 4596 | + |
| 4597 | + ; |
| 4598 | + return 0; |
| 4599 | +} |
| 4600 | +_ACEOF |
| 4601 | +rm -f conftest.$ac_objext |
| 4602 | +if { (ac_try="$ac_compile" |
| 4603 | +case "(($ac_try" in |
| 4604 | + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
| 4605 | + *) ac_try_echo=$ac_try;; |
| 4606 | +esac |
| 4607 | +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" |
| 4608 | +$as_echo "$ac_try_echo") >&5 |
| 4609 | + (eval "$ac_compile") 2>conftest.er1 |
| 4610 | + ac_status=$? |
| 4611 | + grep -v '^ *+' conftest.er1 >conftest.err |
| 4612 | + rm -f conftest.er1 |
| 4613 | + cat conftest.err >&5 |
| 4614 | + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 4615 | + (exit $ac_status); } && { |
| 4616 | + test -z "$ac_c_werror_flag" || |
| 4617 | + test ! -s conftest.err |
| 4618 | + } && test -s conftest.$ac_objext; then |
| 4619 | + pgac_cv_prog_cc_cflags__Wformat_truncation=yes |
| 4620 | +else |
| 4621 | + $as_echo "$as_me: failed program was:" >&5 |
| 4622 | +sed 's/^/| /' conftest.$ac_ext >&5 |
| 4623 | + |
| 4624 | + pgac_cv_prog_cc_cflags__Wformat_truncation=no |
| 4625 | +fi |
| 4626 | + |
| 4627 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4628 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4629 | +CFLAGS="$pgac_save_CFLAGS" |
| 4630 | +fi |
| 4631 | +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wformat_truncation" >&5 |
| 4632 | +$as_echo "$pgac_cv_prog_cc_cflags__Wformat_truncation" >&6; } |
| 4633 | +if test x"$pgac_cv_prog_cc_cflags__Wformat_truncation" = x"yes"; then |
| 4634 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" |
| 4635 | +fi |
| 4636 | + |
| 4637 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4638 | + CFLAGS="$CFLAGS -Wno-format-truncation" |
| 4639 | + fi |
| 4640 | + NOT_THE_CFLAGS="" |
| 4641 | + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wstringop-truncation" >&5 |
| 4642 | +$as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; } |
| 4643 | +if test "${pgac_cv_prog_cc_cflags__Wstringop_truncation+set}" = set; then |
| 4644 | + $as_echo_n "(cached) " >&6 |
| 4645 | +else |
| 4646 | + pgac_save_CFLAGS=$CFLAGS |
| 4647 | +CFLAGS="$pgac_save_CFLAGS -Wstringop-truncation" |
| 4648 | +ac_save_c_werror_flag=$ac_c_werror_flag |
| 4649 | +ac_c_werror_flag=yes |
| 4650 | +cat >conftest.$ac_ext <<_ACEOF |
| 4651 | +/* confdefs.h. */ |
| 4652 | +_ACEOF |
| 4653 | +cat confdefs.h >>conftest.$ac_ext |
| 4654 | +cat >>conftest.$ac_ext <<_ACEOF |
| 4655 | +/* end confdefs.h. */ |
| 4656 | + |
| 4657 | +int |
| 4658 | +main () |
| 4659 | +{ |
| 4660 | + |
| 4661 | + ; |
| 4662 | + return 0; |
| 4663 | +} |
| 4664 | +_ACEOF |
| 4665 | +rm -f conftest.$ac_objext |
| 4666 | +if { (ac_try="$ac_compile" |
| 4667 | +case "(($ac_try" in |
| 4668 | + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
| 4669 | + *) ac_try_echo=$ac_try;; |
| 4670 | +esac |
| 4671 | +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" |
| 4672 | +$as_echo "$ac_try_echo") >&5 |
| 4673 | + (eval "$ac_compile") 2>conftest.er1 |
| 4674 | + ac_status=$? |
| 4675 | + grep -v '^ *+' conftest.er1 >conftest.err |
| 4676 | + rm -f conftest.er1 |
| 4677 | + cat conftest.err >&5 |
| 4678 | + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 4679 | + (exit $ac_status); } && { |
| 4680 | + test -z "$ac_c_werror_flag" || |
| 4681 | + test ! -s conftest.err |
| 4682 | + } && test -s conftest.$ac_objext; then |
| 4683 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=yes |
| 4684 | +else |
| 4685 | + $as_echo "$as_me: failed program was:" >&5 |
| 4686 | +sed 's/^/| /' conftest.$ac_ext >&5 |
| 4687 | + |
| 4688 | + pgac_cv_prog_cc_cflags__Wstringop_truncation=no |
| 4689 | +fi |
| 4690 | + |
| 4691 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 4692 | +ac_c_werror_flag=$ac_save_c_werror_flag |
| 4693 | +CFLAGS="$pgac_save_CFLAGS" |
| 4694 | +fi |
| 4695 | +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wstringop_truncation" >&5 |
| 4696 | +$as_echo "$pgac_cv_prog_cc_cflags__Wstringop_truncation" >&6; } |
| 4697 | +if test x"$pgac_cv_prog_cc_cflags__Wstringop_truncation" = x"yes"; then |
| 4698 | + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" |
| 4699 | +fi |
| 4700 | + |
| 4701 | + if test -n "$NOT_THE_CFLAGS"; then |
| 4702 | + CFLAGS="$CFLAGS -Wno-stringop-truncation" |
| 4703 | + fi |
4574 | 4704 | elif test "$ICC" = yes; then
|
4575 | 4705 | # Intel's compiler has a bug/misoptimization in checking for
|
4576 | 4706 | # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
|
|
0 commit comments