Follow

what if: a c++ compiler setting that generates warnings when two pointers have different types,

_but_ not if one of them is a "void *"?

· Mastodon Twitter Crossposter · 2 · 0 · 1

@SoniEx2 afaik no, but they're not necessary here.

the compiler can figure out what to do, that's why it doesn't return any errors. the issue is that there's either "-fpermissive", which seems to ignore all valid pointer mismatches, or not using it, which reacts to all of them, even ones involving void*.

@devurandom fat pointers could cause issues with void* conversion, because the sizes wouldn't match.

@devurandom What do you mean? C++ already treats implicit re-casting from one pointer type to another as an error, (void *) or otherwise.
And C compilers (GCC and Clang) then generate warnings in exactly that way.
Sign in to participate in the conversation
Cybrespace

cybrespace: the social hub of the information superhighway

jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal