Oldham, Adam wrote:
First, I want to apologize for bombarding the list with some bad questions. I have been thrown on this job porting Pascal code from one platform/compiler to Linux/GPC and I am having a tough time with it.
I am not sure exactly if this is a problem, or a feature of GPC, or a code problem on my end. In a nutshell, I have a makefile that runs through and compiles (but not links) Pascal source into the object files. I have fixed many inconsistencies between the compilers so far.... but this one is a bit stranger.
So far it compiles source files fine up to one where I get this error: phileif.pas:1102: incompatible type for argument 1 of `Getcurlangphrase'
This function is being called as such: GetCurLangPhrase(Asterisk, 2, AddrType(@SearchStr));
The Prototype for the function is: PROCEDURE GetCurLangPhrase( Phrase_Id : eSysMessages; Buf_Size : INTEGER; Phrase_Buf : AddrType );
And lastly eSysMessages is an enumerated type containing Asterisk from the call.
OK.... The Function is declared in a file called sysutl.pas, eSysMessages is in a global.pas, and the call of GetCurLangPhrase is in phileif.pas. Now, sysutl compiles to object code with no errors or warnings as does global. And phileif.pas USES both global and sysutl with the UNITs being defined correctly. This compiles with an old non-standard compiler, but doesn't with GPC and I can't figure it out for the life of me. The odd thing is, I can comment the line out, and this will happen for other function calls where a value in an enumerated type sits in a function call.
Has anyone seen anything like this? Or does USES work differently with gpc than with other compilers?
There was such a bug (cf. test programs baby2.pas, sam12.pas, maur6.pas), but according to the to-do list it was fixed 1999-06-18. If you're using an older version of GPC, please upgrade...
Frank