Pascal Viandier wrote:
The original header files contained all things to be visible outside of their corresponding module. In fact, the original code was somewhat wrong. The goal was to have one copy of the variable, shared by many modules, with an initial value with a possibility to change its value.
OK, that's the normal functionality of modules and units.
I am not sure if it was possible with SUN Pascal except by using global variables initialized at the beginning of each program.
Don't know, but if it's like C, you'd have to declare the variable non-extern with an initial value in one file, and extern without initial value everywhere, such as in a common include file.
Also with SUN Pascal all symbols are exported by default (again like in C).
No. In C, nothing is exported by default. You have to put each declaration into a header file yourself.
My terminology is not very good I think :-( By exported I meant a symbol can be seen from the outside of its module simply by declaring it "extern".
I see, you mean on the linker level. Yes, unless the original definition was static.
This is not possible with gpc, isn't it?
Theoretically yes, but since we have qualified identifiers, you'd have to "guess" it's linker name (not recommended). You can, however, declare a fixed linker name (`attribute (name = 'foobar')') and then refer to this linker name in an external declaration. Between Pascal modules, this is not recommended at all (the compiler can't check that they match), but if you need to access Pascal definitions from C (or other languages) code, you might need this.
Frank