Martin Liddle wrote:
I am experimenting with gpc 20021128 built with gcc 3.2.1. However I have a compilation problem. The following code fails to compile with the error message:
ml.p:12: passing arg1 of Sys_stat from incompatible array.
The code compiles OK under 20020426 based on gcc 2.95.2.
Am I doing something wrong or is this a bug? (Note if the function rmdir line is commented out in ml2 then the program compiles. If the code of ml2 is merged with ml then the code compiles).
Another stylistic comment (but maybe this was also only done for demonstration purposes): In generally, it's easier and more portable to use the predefined types (such as `CString', with automatic conversion from Pascal strings) and routines (such as `RmDir', file bindings or `Stat' if you need it for some reason) where they are available instead of direct system calls. (Besides, if you do so, a better translation of `char *' would be `protected var Path: Cstring0'. Of course, then a function returning `Cstring0' could not be used for the actual parameter, but there's no guarantee that GPC will always pass value parameters as pointers.)
Apart from that, I can reproduce the problem and will try to fix it (martin6.pas).
Frank