[fpc-devel]Bug or missing documentation?

Peter Vreman peter at freepascal.org
Fri Nov 7 13:22:27 CET 2003

> Hello.
> The code below gives: "foo.pas(13,33) Error: Duplicate identifier NAME"
> when compiled with -S2. It compiles ok with -Sd though.
> The thing is, I coudn't find any reference to this difference of
> behavior under the "Compiler Modes" section of FPC docs, neither in
> other sections.
> Is this a bug, or I missed something in the docs?
> Thanks for your time and work.

It is a decision that we made for fpc mode to force you to write code that
is less buggy. Because using name in the method it is not clear from the
source which name you want to use unless you know that the compiler
prefers locals over object fields.

You need to decide for yourself: Use the stricter fpc mode or the delphi
mode. For delphi mode the reference is the syntax of delphi. We try to
follow it as close as possible.

Reporting issues that work in delphi mode and not in objfpc mode will
almost always be rejected. We made the decision for those. And when you
don't like objfpc mode then just continue to use delphi mode, we don't
force you to use objfpc mode.

More information about the fpc-devel mailing list