Frank,
So, once this bug is fixed, will function declarations in the interface and function bodies in implementation sections of different files be allowed, like they are today? And if not, can the bug sort of be left for compatibility with other Pascal Languages that do utilize this method? Say with maybe a command line parameter?
Adam
-----Original Message----- From: Frank Heckenbach [mailto:frank@g-n-u.de] Sent: Thursday, October 18, 2001 3:00 PM To: gpc@gnu.de Subject: Re: Is this a bug that is planning to be fixed (from documentation)?
Oldham, Adam wrote:
I have a question about something that is stated below
"Note that GPC does not yet check whether all interface declarations are resolved in the same unit. Procedures and functions which are in fact not used may be omitted, and/or procedures and functions may be implemented somewhere else, even in a different language. However, relying on a GPC
bug
(that will eventually be fixed) is not a good idea, so this is not recommended."
In the Programmer's Guide -> Source Structures -> Modules and Unites -> Units
The comment about ..."relying on a GPC bug (that will eventually be fixed) is not a good idea, so this is not recommended.", what is the GPC bug and which part of its paragraph does it apply to?
That GPC does not yet check whether all interface declarations are resolved in the same unit (like they should by definition of both EP modules and BP units).
1 - "...Procedures and functions which are in fact not used may be omitted, "
I.e., you can declare a routine, never implement it, and as long as it's not actually called, GPC will not complain (but it should).
2 - "...Procedures and functions may be implemented somewhere else, even in a different language."
You can declare a routine in the normal way and provide the implementation, say, in a C file. GPC should also complain here, unless you declare them as `external' (which, BTW, is the answer to the problem described; I'll add it to that paragraph in the manual).
I a, a bit confused as to what this bug is. I looked in the list of known bugs and didn't seem to see anything that directly related to this.
I don't find it there either, so I'm adding it now ...
Frank
Oldham, Adam wrote:
So, once this bug is fixed, will function declarations in the interface and function bodies in implementation sections of different files be allowed, like they are today?
Different files for the same module, yes (unfortunately, since EP more or less requires this, though it doesn't directly talk about source files). Different units/modules, no.
And if not, can the bug sort of be left for compatibility with other Pascal Languages that do utilize this method? Say with maybe a command line parameter?
Which compiler uses this method? I only know compilers that require such routines to be declared as `external' or similar, and GPC will (continue to) allow this as well.
Disabling this check would be easy at first, but once we introduce qualified identifiers, the method won't work, since the implementation would choose another "mangled linker name" (if you don't know what that means, please ignore it) than the interface declaration, and without an explicit specification (such as `external' and/or `asmname'), it won't work.
Frank