July 29, 2019 Re: void* pointers get corrupted: D bug or misunderstanding? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Federico Santamorena | On Monday, 29 July 2019 at 15:26:34 UTC, Federico Santamorena wrote:
> I still actually want to push the idea that a void* pointer to a void* pointer should be a warning emitted by the compiler.
>
> Or even better a new flag emitting warnings for fishy void* pointers manipulation.
>
> Ideas about this?
Quick thoughts:
- there are legimate usecases for void**
- warnings are generally bad. They are either treated as pedantic non-standard errors, or they pile up until no-one looks at them anymore.
- it's going to be annoying in generic code, templates need special checks that &T is not done if T may be a void*.
- compilers already have like 100 flags
|
Copyright © 1999-2021 by the D Language Foundation