Extended Pascal allows for importing an identifier of the same spelling in the same scope through multiple interfaces as long as all the imports "denote the same value, variable. procedure, function, schema, or type". If they do not denote the same thing then there is an error of multiple defining-points for the identifier being imported through multiple interfaces. (See ISO 10206 paragraphs 6.2.2.7 and 6.11.3 for the requirements language.)
While GPC does allow for the import of an identier through multiple interfaces, GPC does not enforce the requirement that all the imports denote the same thing. Is this a known bug in GPC's support for Extended Pascal?
A test program demonstrating the problem:
{$extended-pascal} program grp1(input, output);
{Undetected import error. Type identifer 't1' imported through grp1b does not denote the same type as type identifier 't1' imported through grp1a.}
import grp1a; grp1b;
begin writeln('FAIL'); end.
{$extended-pascal} module grp1a; export grp1a = (t1); type t1 = char; end;
end.
{$extended-pascal} module grp1b; export grp1b = (t1); type t1 = integer; end;
end.
compiled with: gpc --automake -v grp1.pas -o grp1 Reading specs from /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/specs Configured with: ../gpc-3.3d6/configure --enable-languages=pascal,c --enable-threads=posix --prefix=/Developer/Pascal/gpc33d6 --target=powerpc-apple-darwin Thread model: posix gpc version 20030507, based on gcc-3.3 /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/gpcpp -D__BITS_BIG_ENDIAN__=1 -D__BYTES_BIG_ENDIAN__=1 -D__WORDS_BIG_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -quiet -v -iprefix /usr/bin/../lib/gcc-lib/powerpc-apple-darwin/3.3/ -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__DYNAMIC__ grp1.pas -fautomake -famtmpfile=/var/tmp//ccgw5pLe.gpa /var/tmp//ccZXMYCf.i GNU Pascal Compiler PreProcessor version 20030507, based on gcc-3.3 (Darwin/PowerPC) /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/gpc1 /var/tmp//ccZXMYCf.i -fPIC -quiet -dumpbase grp1.pas -auxbase grp1 -version -fautomake -famtmpfile=/var/tmp//ccgw5pLe.gpa -o /var/tmp//cc3HAIMV.s GNU Pascal version is actually 20030507, based on gcc-3.3 GNU Pascal version 3.3 (powerpc-apple-darwin) compiled by GNU C version 3.3. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Reading specs from /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/specs Configured with: ../gpc-3.3d6/configure --enable-languages=pascal,c --enable-threads=posix --prefix=/Developer/Pascal/gpc33d6 --target=powerpc-apple-darwin Thread model: posix gpc version 20030507, based on gcc-3.3 /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/gpcpp -D__BITS_BIG_ENDIAN__=1 -D__BYTES_BIG_ENDIAN__=1 -D__WORDS_BIG_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -quiet -v -iprefix /usr/bin/../lib/gcc-lib/powerpc-apple-darwin/3.3/ -M -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__DYNAMIC__ grp1a.pas -o /var/tmp//ccoq7D0z -fautomake -famtmpfile=/var/tmp//ccgw5pLe.gpa GNU Pascal Compiler PreProcessor version 20030507, based on gcc-3.3 (Darwin/PowerPC) Reading specs from /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/specs Configured with: ../gpc-3.3d6/configure --enable-languages=pascal,c --enable-threads=posix --prefix=/Developer/Pascal/gpc33d6 --target=powerpc-apple-darwin Thread model: posix gpc version 20030507, based on gcc-3.3 /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/gpcpp -D__BITS_BIG_ENDIAN__=1 -D__BYTES_BIG_ENDIAN__=1 -D__WORDS_BIG_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -quiet -v -iprefix /usr/bin/../lib/gcc-lib/powerpc-apple-darwin/3.3/ -M -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__DYNAMIC__ grp1b.pas -o /var/tmp//ccEGg8MF -fautomake -famtmpfile=/var/tmp//ccgw5pLe.gpa GNU Pascal Compiler PreProcessor version 20030507, based on gcc-3.3 (Darwin/PowerPC) as -o /var/tmp//ccHb3AkK.o /var/tmp//cc3HAIMV.s /Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/collect2 -dynamic -o grp1 -lcrt1.o -lcrt2.o -L/Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3 -L/Developer/Pascal/gpc33d6/lib/gcc-lib/powerpc-apple-darwin/3.3/../../.. grp1b.o grp1a.o /var/tmp//ccHb3AkK.o -lgpc -lgcc -lSystem | c++filt3
Gale Paeper gpaeper@empirenet.com
Gale Paeper wrote:
Extended Pascal allows for importing an identifier of the same spelling in the same scope through multiple interfaces as long as all the imports "denote the same value, variable. procedure, function, schema, or type". If they do not denote the same thing then there is an error of multiple defining-points for the identifier being imported through multiple interfaces. (See ISO 10206 paragraphs 6.2.2.7 and 6.11.3 for the requirements language.)
While GPC does allow for the import of an identier through multiple interfaces, GPC does not enforce the requirement that all the imports denote the same thing. Is this a known bug in GPC's support for Extended Pascal?
Yes, it's related to the whole topic of qualified identifiers etc.
A test program demonstrating the problem:
Thanks (put in todo/).
Frank