[Lazarus] Forward declaration not solved

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Aug 9 22:00:18 CEST 2013

Santiago Amposta schrieb:
> El 09/08/2013 11:15, Antonio Fortuny escribió:
>> But the isn't there some ambiguity between LCL declarations and FPC
>> declarations for what is obviously the same type ?
>> Thanks Mattias,
> In delphi, exists sysutils.abort and windows.abort. I don't know how
> long it took me to find the bug: Just because "windows" was used after
> "sysutils". In this case the compiler didn't complain, and the errors
> where very weird.
> Other languages, like Ada, raise a compiler error.  IMHO, the FPC should
> not allow such ambiguity and raise an error, asking to qualify the
> identifier. I suppose it would break backward compatibility, a directive
> {$Check_Ambiguity+} would be fine for me ;-)

Some more people would like something like that. The compiler developers 
most probably won't, because it would slow down compilation.

As a compromise a directive $RequireQualification could be added, 
forcing error messages with *all* unqualified identifiers in the unit. 
This in fact could speed up compilation, because searching the Uses 
lists is not required any more. But before using such an switch a tool 
or feature would be required to qualify all unambiguous identifiers, and 
to offer choices for the ambiguous ones.

A global directive won't work, because the FCL, LCL and all other 
library writers most probably won't update their code, only to please 
some users. And I wouldn't like that, too, because it adds so many 
qualifiers to the code, that it will become almost unreadable to me (and 
other coders).

> Sure it's a FPC topic, but I couldn't help... it's just a rant ;-)

Ask again in FPC-devel, or create an feature request.

Or write your own tool for finding ambiguous declarations, and the whole 
world will praise you ;-)


More information about the Lazarus mailing list