Zero-length static array spec

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 09:37:36 PST 2015


On Friday, 6 February 2015 at 16:57:11 UTC, ketmar wrote:
> that's easy: just start assigning increasing addresses from end 
> of ram or
> start of ram for each "infinitely small" local. as passing it's 
> address
> is an invalid operation, the only valid thing one can do is 
> compare it
> with null or some other address, and pass the result of 
> comparison, so
> it's ok.

You mean assigning during compilation by keeping some global 
state around somewhere? I think this would cause all kinds of 
issues with separate compilation and/or reproducibility of builds.

Using some kind of unique hash identifying the variable 
declaration might just work, but before starting to forge 
addresses and hoping that they don't overlap another allocation 
(on a 32 bit system) or otherwise confuse users, I'd rather be 
sure that there is value in this behavior in the first place.

David


More information about the Digitalmars-d mailing list