Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2025-11

inconsistent source parsing ? (deprecated)

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

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;
program Project1;
{$Mode objfpc}
var
   foo: procedure cdecl; deprecated = nil;
   //bar: procedure cdecl; deprecated;
begin
   foo := nil; // issues: Note: foo is deprecated
end.

Reply by email

Martin Frb
to Martin Frb
Martin Frb wrote 7 lines
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.

Reply by email