[Lazarus] Parser
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Thu Jul 1 18:56:26 CEST 2010
Michael Schnell schrieb:
>> Ask yourself why GCC doesn't have preprocessed headers,
> I supposed you mean "precompiled headers" and not "headers that are
> passed through the preprocessor.
>
> This is according to what I called the "C philosophy" in the other mail.
> Even if this philosophy is simplistic and introduced by need rather than
> by science, it _is_ consistent and workable.
There is one problem with the independent header files: what if modules
are compiled with #defines or an #include stack, that differ from those
used to compile another (used) module itself?
FPC overcomes this problem with the .ppu files (I assume), C++ with
mangled names, reflecting the precise attributes of every compiled item.
This problem also should make clear that (standard) header files *must*
be compiled with the same settings, or better must be insensitive to all
external #defines or previously #included files, so that a project uses
the same compilation parameters for all referenced modules. In so far
it's perfectly acceptable to use precompiled header files, that match
the compiled version of every module in a project or library. The
compiler only should place and search for such precompiled headers in
the object directory, into which a module (to be linked) has been
compiled. But this in turn would require to pass the path to every
single library folder to the compiler...
DoDi
More information about the Lazarus
mailing list