[fpc-pascal] strange compiler message
Michalis Kamburelis
michalis at camelot.homedns.org
Tue Nov 8 01:33:58 CET 2005
dhkblaszyk at zeelandnet.nl wrote:
> Hi,
>
> When I want to compile a unit, I get a strange error message:
>
> Warning: Comment level 2 found
>
> The lines involved do contain comments that use brackets {}.
>
> Anybody any ideas what might be causing the compiler messages??
>
"Comment level 2 found" is only a warning, so I guess that you get some
error message further. "Comment level 2 found" means that you triggered
nested comments mechanism. In FPC in objfpc (and fpc and probably some
others) modes, comments can be nested, which means that e.g.
{$mode objfpc} { { } begin end.
*is not* a valid Pascal program. But in Delphi mode, e.g.
{$mode delphi} { { } begin end.
*is* a valid program.
In other words: what you want is probably to just compile your unit in
delphi mode, so that nested comments are off.
Michalis
More information about the fpc-pascal
mailing list