consider: int f(unsigned char **); int g(char *p) { return f((unsigned char **)&p); } such code is almost surely wrong (if f dereferences its argument) this is a common mistake and it seems gcc-11 will optimize such code more aggressively which can lead to broken behavior, see bug 97264. so it would be useful to simply warn about casts between pointer types that cannot alias. e.g.: "warning: dangerous cast from `char **` to `unsigned char **` can lead to aliasing violation [-Wpointer-cast]" does not have to be in -Wall, but the current aliasing warnings are too weak to catch bugs like in the example.
> gcc t5.c -O2 -Wstrict-aliasing=2 t5.c: In function 'g': t5.c:5:32: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 5 | return f((unsigned char **)&p); | ^~ so it already works.