Unit name vs. filename mismatch

Frank Heckenbach frank at g-n-u.de
Wed Apr 30 23:58:18 CEST 2003

Grant Jacobs wrote:

> I feel mean suggesting work for you, but another low priority 
> warning/error message thing...
> Any merit in a warning message (not an error) if a unit name differs 
> from its filename?  If you do something like:
>    Unit1:
>      uses GHJ_AAConsensus;
>    Unit2, named 'GHJ_AAConsensus.pas'
>      unit Consensus;
> On compiling Unit1, you get a compile-time message like:
>    module/unit `ghj_aaconsensus2' could not be compiled
> which is pretty broad!
> I imagine many users would use the same name for the unit as to the 
> file as if nothing else its easy to locate the file if they have the 
> same name, so a warning if they differ might be useful?
> It'd be a bit of a bonus really as its a "useability" thing not a bug fix.

OK (`-W[no-]interface-file-name', not on by default or with
`-Wall'). ("Interface" because for modules it will apply to the
interface names which is where it matters, and which might be
distinct from the module name. For units it's the same.)


Frank Heckenbach, frank at g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
GPC download signing key: 51FF C1F0 1A77 C6C2 4482  4DDC 117A 9773 7F88 1707

More information about the Gpc mailing list