LDC 1.0.0-alpha1 has been released! Please help testing!

kink via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Mon Feb 29 05:36:59 PST 2016


On Monday, 29 February 2016 at 11:51:31 UTC, Andrea Fontana wrote:
> It takes me a lot to understand what's wrong in a parser code.
> I finally reduced code to this:
>
> size_t inc(size_t* v)
> {
>    (*v)++;
>    return 10;
> }
>
> size_t pos = 10;
> 	
> immutable tst = pos + inc(&pos); // <-- this
> writeln(tst);
> writeln(pos);
>
> The marked line was an unintended mistake inside original code.
> Anyway it gives different result with dmd and ldc2 1.0. I 
> neither know if is a undefined behaviour.

I hope LDC computes tst = 20. ;)
Iirc, there were some inconsistencies wrt. this. LDC and GDC do 
it one way (the proper one imo), dmd another way.


More information about the digitalmars-d-ldc mailing list