3 ms·
In that case, I guess >C has a type system, but the developers are ignoring it, preferring to move stuff around as void *. is alleging that C programmers insi
by shrimp_emoji 4y ago
In that case, I guess
>C has a type system, but the developers are ignoring it, preferring to move stuff around as void *.
is alleging that C programmers insist on literally keeping their allocated variables behind `void*`s.
That's too weird to me. :p Because, yeah, you don't need an explicit cast from a `void*` returned from a `malloc`, and I assume everyone tacitly assigns that `void*` to a `Foo*` immediately.
The only case where you're converting stuff to `void*`s is when passing/taking it to/from "generic" APIs, where it could be any type. (Hence "move stuff around".) I thought OP was alleging there's no problems with this practice, although that interpretation of mine doesn't make sense from what they said in retrospect.