[fpc-devel] Is that intended: {$define 2} ... {$IFDEF 2}

Michael Van Canneyt michael at freepascal.org
Mon Dec 8 11:08:07 CET 2025



On Sun, 7 Dec 2025, Martin Frb via fpc-devel wrote:

> On 06/12/2025 11:10, Michael Van Canneyt via fpc-devel wrote:
>>
>>
>> On Fri, 5 Dec 2025, Martin Frb via fpc-devel wrote:
>>
>>> $define/$Ifdef don't just take (name) identifiers.
>>>
>>> They also take numbers, <strike>and expressions. </strike>
>>>
>>> Well actually, numbers.
>>> {$define 2}
>>> {$IFDEF 2} .... {$ENDIF}
>>>
>>
>> Seriously ?
>>
>> The inventive ways by which people try to shoot themselves in the foot 
>> never
>> cease to amaze me...
>>
>> They do it with lots of enthusiasm, it seems :-)
>
> Ok, so the docs says defines a "name" or "symbol", it does not refer to 
> "identifier". Which means I guess numbers are in that scope.

I doubt this is intentional, but if it makes you happy...

Michael.


More information about the fpc-devel mailing list