Loss of --diag_suppress from pgcc/nvc

I have been a user of the PGI compiler suite since 2005.
In release 20.1 one of the greatest flaws in the C compiler was finally addressed with the introduction of the --diag_suppress* switches (already present in the C++ compiler prior to that).
So, WHY on earth did NVIDIA’s first rebranded 20.7 remove this switch family?
I am back to use of -w to because there is no longer any way to silence stupid warnings (like telling me a call to __builtin_unreachable()is unreachable) while retaining meaningful ones.

Hi Paul,

“–diag_suppress” is actually a flag to the EDG C++ front end that we use for our C++. With 20.1, pgcc was updated to use EDG (in C mode) and why the flag suddenly appear. However I believe our engineers went through a process, for consistency, of getting the new pgcc flag set to be closer to the older pgcc flag set. While I don’t know the particulars for “–diag_supress”, I’ve added a RFE, (TPR #28860) to see if we can it back.

In the meantime, you can try using the option “-Wc,–diag_supress=…” instead. “-Wc” passes flags directly to the C++ front-end.

Apologies for the inconvenience,
Mat

Mat,

Your suggestion (which mentioned the C++ front-end) is not helping with C (where I have the issue):

$ nvc --version

nvc 20.7-0 LLVM 64-bit target on x86-64 Linux -tp nehalem
NVIDIA Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION.  All rights reserved.
   
$ nvc -Wc,--diag_suppress177 hello.c
Command-line error: invalid option: --diag_suppress177

1 catastrophic error detected in this compilation.
Compilation terminated.

For comparison, below is the behavior of the 20.4 release which accepts the bare option but not the use of -Wc,...:

$ pgcc --version

pgcc (aka pgcc18) 20.4-0 LLVM 64-bit target on x86-64 Linux -tp nehalem
PGI Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION.  All rights reserved.

$ pgcc --diag_suppress177 hello.c && echo PASS
PASS

$ pgcc -Wc,--diag_suppress177 hello.c && echo PASS
Command-line error: invalid option: --diag_suppress177

1 catastrophic error detected in this compilation.
Compilation terminated.

For completeness, I should note that -Wc,... does appear in the output of nvc --help-switch but is not present in the man page (where 0 is given as the “compiler” pass).

An attempt with -W0,... also fails, though with a different message:

$ nvc -W0,--diag_suppress177 hello.c && echo PASS
NVC++-S-0011-Unrecognized command line switch: --diag_suppress177 ()
NVC++/x86-64 Linux 20.7-0: compilation completed with severe errors

-Paul

Can you try it with the equal sign included, i.e. “-Wc,–diag_suppress=177”, or alternatively a comma, " -Wc,–diag_suppress,177"?

The 20.1 pgcc parsed the “–diag_suppress177” option so it’s presented to the C++ front-end compiler as “–diag_suppress 177”. When using the -Wc option, we need to add a delimiter between the argument and the value being passed to differentiate between the flag, “–diag_suppress” and the argument, “177”.

Mat,

Yes, nvc -Wc,--diag_suppress=177 hello.c appears to work.
I’d love the “bare” spelling to return, but can work with this for the time being.

-Paul

We should support --diag_suppress again now in 20.9. Thanks for the report.