[Issue 10763] (&x)[0 .. 1] doesn't work in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 03:42:55 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10763


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at ubuntu.com


--- Comment #7 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-08-19 03:42:54 PDT ---
(In reply to comment #3)
> It's basically the same as issue 10266.
> The corner cases arise if you still disallow &x + 1. My guess is that you're
> allowing it in your implementation?
> 
> The problem with allowing it is that we're departing from C. And there's
> annoying things like:
> 
> // global scope
> int x;
> int *p = &x + 1; // points to junk! - must not compile
> 
> 
> Is there really a use case for this unsafe behaviour?

Only one would be in std.math if we want to make the elementary functions
CTFE-able (we've discussed this before).

But yes, I think that it is right to disallow it, as there is no clean way to
slice up basic types into an array and guarantee ie: format or endian
correctness at compile time (cross-compilers, for instance).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list