@@ -4407,6 +4407,202 @@ if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4407
4407
CFLAGS="$CFLAGS -fexcess-precision=standard"
4408
4408
fi
4409
4409
4410
+ # We want to suppress clang's unhelpful unused-command-line-argument warnings
4411
+ # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
4412
+ # test for the positive form and if that works, add the negative form
4413
+ NOT_THE_CFLAGS=""
4414
+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wunused-command-line-argument" >&5
4415
+ $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
4416
+ if test "${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+set}" = set; then
4417
+ $as_echo_n "(cached) " >&6
4418
+ else
4419
+ pgac_save_CFLAGS=$CFLAGS
4420
+ CFLAGS="$pgac_save_CFLAGS -Wunused-command-line-argument"
4421
+ ac_save_c_werror_flag=$ac_c_werror_flag
4422
+ ac_c_werror_flag=yes
4423
+ cat >conftest.$ac_ext <<_ACEOF
4424
+ /* confdefs.h. */
4425
+ _ACEOF
4426
+ cat confdefs.h >>conftest.$ac_ext
4427
+ cat >>conftest.$ac_ext <<_ACEOF
4428
+ /* end confdefs.h. */
4429
+
4430
+ int
4431
+ main ()
4432
+ {
4433
+
4434
+ ;
4435
+ return 0;
4436
+ }
4437
+ _ACEOF
4438
+ rm -f conftest.$ac_objext
4439
+ if { (ac_try="$ac_compile"
4440
+ case "(($ac_try" in
4441
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4442
+ *) ac_try_echo=$ac_try;;
4443
+ esac
4444
+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4445
+ $as_echo "$ac_try_echo") >&5
4446
+ (eval "$ac_compile") 2>conftest.er1
4447
+ ac_status=$?
4448
+ grep -v '^ *+' conftest.er1 >conftest.err
4449
+ rm -f conftest.er1
4450
+ cat conftest.err >&5
4451
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4452
+ (exit $ac_status); } && {
4453
+ test -z "$ac_c_werror_flag" ||
4454
+ test ! -s conftest.err
4455
+ } && test -s conftest.$ac_objext; then
4456
+ pgac_cv_prog_cc_cflags__Wunused_command_line_argument=yes
4457
+ else
4458
+ $as_echo "$as_me: failed program was:" >&5
4459
+ sed 's/^/| /' conftest.$ac_ext >&5
4460
+
4461
+ pgac_cv_prog_cc_cflags__Wunused_command_line_argument=no
4462
+ fi
4463
+
4464
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4465
+ ac_c_werror_flag=$ac_save_c_werror_flag
4466
+ CFLAGS="$pgac_save_CFLAGS"
4467
+ fi
4468
+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&5
4469
+ $as_echo "$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&6; }
4470
+ if test x"$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" = x"yes"; then
4471
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
4472
+ fi
4473
+
4474
+ if test -n "$NOT_THE_CFLAGS"; then
4475
+ CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
4476
+ fi
4477
+ # Similarly disable useless truncation warnings from gcc 8+
4478
+ NOT_THE_CFLAGS=""
4479
+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wformat-truncation" >&5
4480
+ $as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; }
4481
+ if test "${pgac_cv_prog_cc_cflags__Wformat_truncation+set}" = set; then
4482
+ $as_echo_n "(cached) " >&6
4483
+ else
4484
+ pgac_save_CFLAGS=$CFLAGS
4485
+ CFLAGS="$pgac_save_CFLAGS -Wformat-truncation"
4486
+ ac_save_c_werror_flag=$ac_c_werror_flag
4487
+ ac_c_werror_flag=yes
4488
+ cat >conftest.$ac_ext <<_ACEOF
4489
+ /* confdefs.h. */
4490
+ _ACEOF
4491
+ cat confdefs.h >>conftest.$ac_ext
4492
+ cat >>conftest.$ac_ext <<_ACEOF
4493
+ /* end confdefs.h. */
4494
+
4495
+ int
4496
+ main ()
4497
+ {
4498
+
4499
+ ;
4500
+ return 0;
4501
+ }
4502
+ _ACEOF
4503
+ rm -f conftest.$ac_objext
4504
+ if { (ac_try="$ac_compile"
4505
+ case "(($ac_try" in
4506
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4507
+ *) ac_try_echo=$ac_try;;
4508
+ esac
4509
+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4510
+ $as_echo "$ac_try_echo") >&5
4511
+ (eval "$ac_compile") 2>conftest.er1
4512
+ ac_status=$?
4513
+ grep -v '^ *+' conftest.er1 >conftest.err
4514
+ rm -f conftest.er1
4515
+ cat conftest.err >&5
4516
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4517
+ (exit $ac_status); } && {
4518
+ test -z "$ac_c_werror_flag" ||
4519
+ test ! -s conftest.err
4520
+ } && test -s conftest.$ac_objext; then
4521
+ pgac_cv_prog_cc_cflags__Wformat_truncation=yes
4522
+ else
4523
+ $as_echo "$as_me: failed program was:" >&5
4524
+ sed 's/^/| /' conftest.$ac_ext >&5
4525
+
4526
+ pgac_cv_prog_cc_cflags__Wformat_truncation=no
4527
+ fi
4528
+
4529
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4530
+ ac_c_werror_flag=$ac_save_c_werror_flag
4531
+ CFLAGS="$pgac_save_CFLAGS"
4532
+ fi
4533
+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wformat_truncation" >&5
4534
+ $as_echo "$pgac_cv_prog_cc_cflags__Wformat_truncation" >&6; }
4535
+ if test x"$pgac_cv_prog_cc_cflags__Wformat_truncation" = x"yes"; then
4536
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
4537
+ fi
4538
+
4539
+ if test -n "$NOT_THE_CFLAGS"; then
4540
+ CFLAGS="$CFLAGS -Wno-format-truncation"
4541
+ fi
4542
+ NOT_THE_CFLAGS=""
4543
+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wstringop-truncation" >&5
4544
+ $as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; }
4545
+ if test "${pgac_cv_prog_cc_cflags__Wstringop_truncation+set}" = set; then
4546
+ $as_echo_n "(cached) " >&6
4547
+ else
4548
+ pgac_save_CFLAGS=$CFLAGS
4549
+ CFLAGS="$pgac_save_CFLAGS -Wstringop-truncation"
4550
+ ac_save_c_werror_flag=$ac_c_werror_flag
4551
+ ac_c_werror_flag=yes
4552
+ cat >conftest.$ac_ext <<_ACEOF
4553
+ /* confdefs.h. */
4554
+ _ACEOF
4555
+ cat confdefs.h >>conftest.$ac_ext
4556
+ cat >>conftest.$ac_ext <<_ACEOF
4557
+ /* end confdefs.h. */
4558
+
4559
+ int
4560
+ main ()
4561
+ {
4562
+
4563
+ ;
4564
+ return 0;
4565
+ }
4566
+ _ACEOF
4567
+ rm -f conftest.$ac_objext
4568
+ if { (ac_try="$ac_compile"
4569
+ case "(($ac_try" in
4570
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4571
+ *) ac_try_echo=$ac_try;;
4572
+ esac
4573
+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4574
+ $as_echo "$ac_try_echo") >&5
4575
+ (eval "$ac_compile") 2>conftest.er1
4576
+ ac_status=$?
4577
+ grep -v '^ *+' conftest.er1 >conftest.err
4578
+ rm -f conftest.er1
4579
+ cat conftest.err >&5
4580
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4581
+ (exit $ac_status); } && {
4582
+ test -z "$ac_c_werror_flag" ||
4583
+ test ! -s conftest.err
4584
+ } && test -s conftest.$ac_objext; then
4585
+ pgac_cv_prog_cc_cflags__Wstringop_truncation=yes
4586
+ else
4587
+ $as_echo "$as_me: failed program was:" >&5
4588
+ sed 's/^/| /' conftest.$ac_ext >&5
4589
+
4590
+ pgac_cv_prog_cc_cflags__Wstringop_truncation=no
4591
+ fi
4592
+
4593
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4594
+ ac_c_werror_flag=$ac_save_c_werror_flag
4595
+ CFLAGS="$pgac_save_CFLAGS"
4596
+ fi
4597
+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wstringop_truncation" >&5
4598
+ $as_echo "$pgac_cv_prog_cc_cflags__Wstringop_truncation" >&6; }
4599
+ if test x"$pgac_cv_prog_cc_cflags__Wstringop_truncation" = x"yes"; then
4600
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
4601
+ fi
4602
+
4603
+ if test -n "$NOT_THE_CFLAGS"; then
4604
+ CFLAGS="$CFLAGS -Wno-stringop-truncation"
4605
+ fi
4410
4606
elif test "$ICC" = yes; then
4411
4607
# Intel's compiler has a bug/misoptimization in checking for
4412
4608
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
0 commit comments