[fpc-devel] inconsistent source parsing ? (deprecated)
Martin Frb
lazarus at mfriebe.de
Sun Nov 16 16:06:52 CET 2025
On 16/11/2025 15:58, Martin Frb via fpc-devel wrote:
> In the below code, foo is accepted, and using foo issues the note that
> it is deprecated.
>
> So having a "deprecated" after the "cdecl; " works.
>
> But only with "= nil".
> the line for "bar" gives an error "begin" expected;
And also, if you had one of the HINT modifiers then you can have a
semicolon followed by cdecl (etc), but not another hint modifier.
program Project1;
{$Mode objfpc}
var
xyz: procedure deprecated; cdecl; experimental = nil; // ERROR
abc: procedure deprecated experimental; cdecl; // OK
foo: procedure cdecl; deprecated = nil;
//bar: procedure cdecl; deprecated;
begin
foo := nil; // issues: Note: foo is deprecated
end.
More information about the fpc-devel
mailing list