-an and help page (Was: Re: [fpc-devel] Re: Episode 4. Addressing and it's limits Part Two)

Tomas Hajny XHajT03 at hajny.biz
Thu Feb 9 17:54:06 CET 2012

On Thu, February 9, 2012 14:45, Mark Morgan Lloyd wrote:
> Tomas Hajny wrote:
>>> Note that to get this level of detail the compiler has to be built with
>>> -dEXTDEBUG in order to enable the -an option, despite the fact that
>>> this
>>> always appears in fpc's -h output. If it were my choice I'd make that
>>> bit of help output conditional.
>> Making it conditional isn't possible without modifying the structure
>> used
>> in the message files (plain text files to allow easy translation /
>> localization to other languages) or their concept / the way how they are
>> used.
>> As it works now, the default (English) text file is translated into an
>> include file containing all texts and compiled into the compiler
>> executable (but another file with the same structure but written in a
>> different language may be supplied on the command line and override the
>> default on run-time). The only conditional parts in the message files
>> are
>> related to platforms and targets (which is a limited set of dependencies
>> by definition); -dEXTDEBUG based dependency doesn't fit into that. The
>> easier solution would be probably adding a note about this dependency
>> directly into the help page (I or anybody else in the core team can do
>> that if it really works that way - i.e., if there is no difference
>> between
>> -an and -a in a compiler compiled without -dEXTDEBUG).
> Thanks for the expiation :-) Would it be possible to do something like
> (a) annotating non-standard options with e.g. "(requires EXTDEBUG)" and

Yes, this is what I suggested to do above; for -an, not in general,
because I don't know of such dependencies myself (I wasn't aware of it for
-an either).

> (b) having a line in the banner showing what non-default options were
> used during build?
> Free Pascal Compiler version 2.7.1 [2012/02/06] for mipsel
> Copyright (c) 1993-2011 by Florian Klaempfl and others
> Built with EXTDEBUG, fvm32.

I'm afraid that this is "a bit" more difficult _if_ we want a general
solution. Addressing individual options explicitly is possible (probably
line by line rather than as a list though). Obviously, this wouldn't be a
general solution. However, I'm not aware of any compiler macro allowing to
list all conditional defines (that would be still the easier part, because
these are obviously known within the compiler so adding a new macro should
be possible, but it may be a long list), and even less a macro allowing to
list just compiler defines added explicitly on the command line (rather
than defined internally for a particular target, implied from some other
command line options or defined within the respective source file)... I'd
wait for opinion of other core team members whether we should add support
for explicit "Built with EXTDEBUG" or do something else (but I'm certainly
not the one who'd add a macro necessary for the general solution).


More information about the fpc-devel mailing list