Forum > FPC development
unexpected behavior in FPC v3.2.2
dbannon:
Yes Marcov, the trailing Parentheses seems to be ignored, $ifdef finds the identifier both with and without the Parentheses. But the leading Parentheses is a problem.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$define (NoNothing} {$define NoSomething)} program _DirectivesParentheses; begin// {$ifdef (NoNothing} // This will not compile// writeln('(NoNothing');// {$endif} {$ifdef NoNothing} writeln('NoNothing'); // This is NOT printed {$endif} {$ifdef NoSomething)} writeln('NoSomething)'); // This IS printed {$endif} {$ifdef NoSomething} writeln('NoSomething'); // This IS printed {$endif}end.
You could argue that the way it is here could lead to one of those bugs where we sit and stare at the computer screen, getting angrier by the minute until we spot that leading Parentheses. But I can think of a other things I'd like to see fixed first !
Davo
Bart:
Delphi 7 does not allow the first one, but allows the second one.
Bart
Navigation
[0] Message Index
[*] Previous page