digitalmars.D.learn - ICE?
- Namespace (4/4) May 17 2015 Is this error an ICE? I think so, because I see the internal
- Gary Willoughby (2/6) May 17 2015 Have you got a code sample to reproduce this?
- Namespace (8/15) May 17 2015 Of course:
- Daniel Kozak via Digitalmars-d-learn (4/23) May 17 2015 I guess it should be:
- Daniel Kozak (5/29) May 17 2015 or this if you want ptr to be char[] and not a pointer to char:
- Namespace (4/28) May 17 2015 That would work, but I did it on purpose. I wanted to test
- Daniel Kozak via Digitalmars-d-learn (16/49) May 17 2015 I see.
- Daniel Kozak (2/6) May 17 2015 I would say this is not an ICE just normal error message.
- anonymous (3/7) May 17 2015 "e2ir: " shouldn't be there, though.
- Daniel Kozak via Digitalmars-d-learn (3/12) May 17 2015 Yep
- ketmar (3/11) May 18 2015 anything including "e2ir" is definitely an ICE, i believe. it should be=...
- Daniel Kozak (2/6) May 19 2015 https://github.com/D-Programming-Language/dmd/pull/4667
Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]
May 17 2015
On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sunday, 17 May 2015 at 09:30:16 UTC, Gary Willoughby wrote:On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Of course: ---- void main() { import core.stdc.stdlib : malloc, free; auto ptr = cast(char[]) malloc(42); } ----Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sun, 17 May 2015 09:33:27 +0000 Namespace via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Sunday, 17 May 2015 at 09:30:16 UTC, Gary Willoughby wrote:I guess it should be: auto ptr = cast(char*)malloc(42)[0 .. 42];On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Of course: ---- void main() { import core.stdc.stdlib : malloc, free; auto ptr = cast(char[]) malloc(42); } ----Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sunday, 17 May 2015 at 09:59:41 UTC, Daniel Kozak wrote:On Sun, 17 May 2015 09:33:27 +0000 Namespace via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:or this if you want ptr to be char[] and not a pointer to char: auto ptr = (cast(char*)malloc(42))[0 .. 42]; or auto ptr = cast(char[])malloc(42)[0 .. 42];On Sunday, 17 May 2015 at 09:30:16 UTC, Gary Willoughby wrote:I guess it should be: auto ptr = cast(char*)malloc(42)[0 .. 42];On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Of course: ---- void main() { import core.stdc.stdlib : malloc, free; auto ptr = cast(char[]) malloc(42); } ----Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sunday, 17 May 2015 at 09:59:41 UTC, Daniel Kozak wrote:On Sun, 17 May 2015 09:33:27 +0000 Namespace via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:That would work, but I did it on purpose. I wanted to test whether such dangerous code compiles or whether the compiler is smart enough and hits the alarm.On Sunday, 17 May 2015 at 09:30:16 UTC, Gary Willoughby wrote:I guess it should be: auto ptr = cast(char*)malloc(42)[0 .. 42];On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Of course: ---- void main() { import core.stdc.stdlib : malloc, free; auto ptr = cast(char[]) malloc(42); } ----Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sun, 17 May 2015 10:36:33 +0000 Namespace via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Sunday, 17 May 2015 at 09:59:41 UTC, Daniel Kozak wrote:I see. for eg.: void main() { import core.stdc.stdlib : malloc, free; static struct arr { size_t length; void* ptr; } auto ptr = cast(arr) malloc(42); } prints: test2.d(9): Error: cannot cast expression malloc(42LU) of type void* to arr which makes sense, even e2ir text is not here.On Sun, 17 May 2015 09:33:27 +0000 Namespace via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:That would work, but I did it on purpose. I wanted to test whether such dangerous code compiles or whether the compiler is smart enough and hits the alarm.On Sunday, 17 May 2015 at 09:30:16 UTC, Gary Willoughby wrote:I guess it should be: auto ptr = cast(char*)malloc(42)[0 .. 42];On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Of course: ---- void main() { import core.stdc.stdlib : malloc, free; auto ptr = cast(char[]) malloc(42); } ----Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]Have you got a code sample to reproduce this?
May 17 2015
On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]I would say this is not an ICE just normal error message.
May 17 2015
On Sunday, 17 May 2015 at 10:09:11 UTC, Daniel Kozak wrote:On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:[...]"e2ir: " shouldn't be there, though.Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]I would say this is not an ICE just normal error message.
May 17 2015
On Sun, 17 May 2015 10:17:42 +0000 anonymous via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Sunday, 17 May 2015 at 10:09:11 UTC, Daniel Kozak wrote:YepOn Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:[...]"e2ir: " shouldn't be there, though.Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]I would say this is not an ICE just normal error message.
May 17 2015
On Sun, 17 May 2015 10:09:10 +0000, Daniel Kozak wrote:On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:anything including "e2ir" is definitely an ICE, i believe. it should be=20 catched by frontend.=Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]=20 I would say this is not an ICE just normal error message.
May 18 2015
On Sunday, 17 May 2015 at 09:25:33 UTC, Namespace wrote:Is this error an ICE? I think so, because I see the internal filename, but I'm not sure. Error: e2ir: cannot cast malloc(length * 8u) of type void* to type char[]https://github.com/D-Programming-Language/dmd/pull/4667
May 19 2015