Thread overview
[Issue 16207] CTFE cast from void* to ubyte* doesn't work
Jun 26, 2016
Walter Bright
Jul 10, 2016
Andrew Godfrey
Jul 10, 2016
ag0aep6g@gmail.com
Jul 10, 2016
Andrew Godfrey
Dec 17, 2022
Iain Buclaw
June 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16207

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=8901

--
June 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16207

uplink.coder@googlemail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uplink.coder@googlemail.com

--- Comment #1 from uplink.coder@googlemail.com ---
The only way around this is passing ubyte[] instead of void[]

I actually like the rigorous type-safety at CTFE.

It's not a bug, It's a feature!

--
July 10, 2016
https://issues.dlang.org/show_bug.cgi?id=16207

Andrew Godfrey <ag.dlang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag.dlang@gmail.com

--- Comment #2 from Andrew Godfrey <ag.dlang@gmail.com> ---
I know what a "void *" is for, but what is the intent of a "const(void)[]"? Does it have a valid length? Does it behave any differently than a "void[]"?

--
July 10, 2016
https://issues.dlang.org/show_bug.cgi?id=16207

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g@gmail.com

--- Comment #3 from ag0aep6g@gmail.com ---
(In reply to Andrew Godfrey from comment #2)
> I know what a "void *" is for, but what is the intent of a "const(void)[]"? Does it have a valid length? Does it behave any differently than a "void[]"?

Please ask such questions in the Learn group of the forum: http://forum.dlang.org/group/learn

Regarding void[], see http://dlang.org/spec/arrays.html (section "Void Arrays" near the bottom). If that doesn't answer all your questions, please make a thread in the forum.

--
July 10, 2016
https://issues.dlang.org/show_bug.cgi?id=16207

--- Comment #4 from Andrew Godfrey <ag.dlang@gmail.com> ---
(In reply to ag0aep6g from comment #3)
> (In reply to Andrew Godfrey from comment #2)
> > I know what a "void *" is for, but what is the intent of a "const(void)[]"? Does it have a valid length? Does it behave any differently than a "void[]"?
> 
> Please ask such questions in the Learn group of the forum: http://forum.dlang.org/group/learn
> 
> Regarding void[], see http://dlang.org/spec/arrays.html (section "Void Arrays" near the bottom). If that doesn't answer all your questions, please make a thread in the forum.

Thanks for the link. I've read that before but didn't retain it.
To this bug, I'm still wondering if it's specific to the const case.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16207

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=16207

--- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19149

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--