strange compiler message

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

strange compiler message

Darius Blaszyk
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??

Darius Blaszijk

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: strange compiler message

L505


>When I want to compile a unit, I get a strange error message:
>
>Warning: Comment level 2 found

Usually a simple mistake, such as an {open comment that you forgot to close.. they can be
tricky to see with your eyes at times.

--
L505
http://z505.com

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: strange compiler message

Michalis Kamburelis
In reply to this post by Darius Blaszyk
[hidden email] 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal