Cannot compile betterC app in windows using stderr

Steven Schveighoffer schveiguy at gmail.com
Sun Feb 13 03:09:30 UTC 2022


On 2/3/22 7:54 PM, Steven Schveighoffer wrote:
> On 2/3/22 5:13 PM, kinke wrote:
>> On Thursday, 3 February 2022 at 21:56:27 UTC, Steven Schveighoffer wrote:
>>> Since pragma inline works now even without the -inline switch, could 
>>> an inline function take the place of the macro?
>>
>> Nope, sadly not - the problem is `&stderr` returning a function 
>> pointer then, not the address of the symbol directly.
> 
> Ugh, yep. Damn us for not correctly implementing @property.
> 
> Would be the same problem with a template as well.

Was going to post about this on Rainer's PR to fix this issue, but as it 
turns out, none of this matters -- on Windows, `stderr` is a constant, 
and in fact the return value from a function.

So `&stderr` isn't valid, and the fact that it currently works is not 
actually correct. In fact, in D currently you can set `stderr` to 
something else, and it won't apply to the C side, which is really bad.

And as a template function, `&stderr` is a compiler error anyway.

-Steve


More information about the Digitalmars-d mailing list