config: add options to suppress some warnings

PGI compilers, now nvc, spits many warnings by default, some of them
not worth to fix. For an example, the warning,
branch_past_initialization force splitting declaring and initializing
local variables with local scopes.

Suppress them by options instead.
Esse commit está contido em:
Hui Zhou
2024-09-23 21:16:46 -05:00
commit 2afc14fa0d
2 arquivos alterados com 19 adições e 0 exclusões
+16
Ver Arquivo
@@ -690,6 +690,22 @@ CFLAGS="$CFLAGS $pac_cc_strict_flags"
export CFLAGS
])
AC_DEFUN([PAC_C_DEFAULT_OPTIONS],[
pac_cc_defaut_flags="
--diag_suppress=branch_past_initialization
"
# See if the above options work with the compiler
accepted_flags=""
for flag in $pac_cc_defaut_flags ; do
PAC_PUSH_FLAG([CFLAGS])
CFLAGS="$CFLAGS $accepted_flags"
PAC_C_CHECK_COMPILER_OPTION([$flag],[accepted_flags="$accepted_flags $flag"],)
PAC_POP_FLAG([CFLAGS])
done
CFLAGS="$CFLAGS $accepted_flags"
export CFLAGS
])
dnl Return the integer structure alignment in pac_cv_c_max_integer_align
dnl Possible values include
dnl packed
+3
Ver Arquivo
@@ -756,6 +756,9 @@ PAC_ARG_CACHING
# it may influence the output of the other tests
PAC_ARG_STRICT
# Add options that suppress default warnings, especially those from PGI compilers (now nvc)
PAC_C_DEFAULT_OPTIONS
# To link C objects with Fortran main program may require -fPIE option
PAC_C_CHECK_fPIE_OK