I would like to submit a case on which I spent some time. It occurred with sources converted to GPC from SUN Pascal with an automated script.
In the interface section of a module, the following statements:
Export MyModule = (A); .... Var A : Integer = 4; attribute(static); ....
This module compiles with no complaint. However for all modules importing MyModule -AND- using A, gpc issues the <error undefined reference to 'A'>.
The problem is: SUN Pascal understands the "static" directive as in C, so the statements above are correct and work - as in C -, but not for GPC. I know the difference between the two "static" flavours but it would have been of great help if gpc had issued at least a warning when compiling MyModule. Something like: "Cannot export a static variable" had saved me some difficult hours.
I did not found any reference to the directive "static" in the 7185 or 10206 standards and the GPC documentation about this is not as clear as it could be. Since I cannot determine if I hit a bug or if it is something one should not bother with, I let you make your own opinion.
Kind regards
Pascal Viandier