Timon Gehr

Results 22 comments of Timon Gehr

Like I said last time, *there should be a comment in the code that this is a temporary hack* that will be removed once the mess with attributes is sorted...

I think this is the wrong way to fix this problem, because it leaves gaping @safe-ty holes. Also see: https://issues.dlang.org/show_bug.cgi?id=19968 Note that issue 19968 is a symptom of a general...

This is NOT a problem specific to bools! - The language specification states that accessing `void`-initialized data is UB. - This can be used to fill private fields of structs...

> > The language specification states that accessing void-initialized data is UB. > > Indeed, and hence this PR to fix that. > > > This is NOT a problem...

> ... > The only thing that really sucks about this is, it's not possible to create a buffer inside a trusted escape -- the whole function must be trusted....

> > you could do this > > I don't know if that works, though. When I declare an instance of `TmpBuffer`, it initializes it to 0s. https://issues.dlang.org/show_bug.cgi?id=11331

> But supporting void initialization for struct fields seems like the best fix, avoiding the need for a nested function and mixin. Yes.

I think there may be the idea that strong and weak purity mean "can optimize" and "cannot optimize", but this is not true. (For example, a weakly pure function that...

Also, I think it is a bit weird that the spec defines "weakly pure" and then "strongly pure" as "pure but not weakly pure".