On 01/30/2017 02:39 PM, Eric Blake wrote:

I don't think test-intprops.c is compatible with the PGI compilers.

Yes, test-intprops.c runs afoul of a problem in the PGI compiler. I can reproduce the problem in PGI 16.10 x86-64 by compiling this one-line program:

  short bar = -32768 <= 100000 && 100000 <= 32767  ? (short) 100000 : 0;

Although this is valid C code and is well-defined to initialize 'bar' to 0 on x86-64, pgcc warns "Constant value out of range for signed short or char". Since the expression "(short) 100000" is not evaluated, the warning is bogus. Although PGI generates thousands of similar warnings for test-intprops.c, I expect that they are all bogus and that you can ignore them. As 'make check' does not fail and I don't see an easy way to suppress the bogus warnings, I suspect we ought to leave the code alone.

Admittedly these warnings are annoying. Adam, since you're a PGI user, perhaps you could report the compiler bug or bugs to the PGI maintainers.

While I was at it, I looked at the other warnings that PGI generates for GNU M4, and managed to silence most of the rest with this Gnulib patch:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=16f6a8d8d81cc93745a24c0fb89caab2c383ae3c

A half-dozen or so of the thousands of Gnulib warnings were actual portability bugs in Gnulib, which made the exercise worth doing I suppose. I don't think these bugs affect GNU M4.

Reply via email to