I’m trying to get one of my projects (Squash) working with PGI. One relatively obscure part of C99 we use is conformant array parameters, and pgcc 16.10 has some trouble with it.
The problem occurs when the size parameter is a pointer (i.e., an in/out parameter) and there is a prototype. A quick test case:
#include <string.h>
void clear_buffer (size_t* buffer_size, unsigned char buffer[*buffer_size]);
void
clear_buffer (size_t* buffer_size,
unsigned char buffer[*buffer_size]) {
memset(buffer, 0, *buffer_size);
}
$ pgcc -c99 -c -o foo.o foo.c
PGC-S-0094-Illegal type conversion required (foo.c: 7)
PGC/x86-64 Linux 16.10-0: compilation completed with severe errors
Commenting out the prototype gets rid of the errors.
Interestingly, the error comes from the function prototype in Squash, but not the test case. I haven’t been able to produce a test case which reproduces that, but I’m hoping it’s the same issue… if you’d like to test that:
git clone https://github.com/quixdb/squash.git
cd squash
git checkout 969591325b43247774196460ac7970e2e94b7be7
mkdir build && cd build
../autogen.sh CC=pgcc CXX=pgc++
make VERBOSE=1
You should end up with something like
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-file.h: 68)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-file.h: 104)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 57)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 60)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 83)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 89)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 95)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 149)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 156)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 164)
PGC-S-0094-Illegal type conversion required (/home/nemequ/local/src/squash/squash/squash-codec.h: 171)
PGC/x86-64 Linux 16.10-0: compilation completed with severe errors