Comments inside {$ifdef X the rest is comment} are not documented
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
This is legal syntax and exists for years:
begin
{$ifdef CPUARM this code is for arm only} // everything after CPUARM is a comment
writeln ('arm');
{$endif arm specific code} // everything after arm is a comment.
end.
Problem is that some people do not realize that and expect something else, like
program untitled;
{.$define red}
{$define blue}
begin
{$ifdef red or $ifdef blue} // everything after red is a comment
writeln ('read or blue');
{$endif red or blue} // everything after red is a comment.
end.
Steps to reproduce:
See the above code examples.
A documentation for this feature and a warning not to misinterpret this feature is probably warranted.
https://www.freepascal.org/docs-html/current/prog/progse4.html#x135-1360002.1
Additional information:
See: http://forum.lazarus.freepascal.org/index.php/topic,43162.msg301645.html#msg301645
Mantis conversion info:
- Mantis ID: 34532
- OS: all
- OS Build: all
- Platform: all
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 1517 (#c5f78be1)
- Target version: 3.2.0