[Bug other/94182] Document -Wchar-subscripts
roland.illig at gmx dot de
gcc-bugzilla@gcc.gnu.org
Mon Mar 16 03:29:15 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
--- Comment #3 from Roland Illig <roland.illig at gmx dot de> ---
(In reply to Andrew Pinski from comment #2)
> Considering it is documented in another place where char is signed or
> unsigned. I don't know if this needs to change.
Given only the compiler warning about "char subscript", how could I possibly
get to the documentation you linked?
> int demo(char ch, int *data) {
> return data[ch];
> }
When I try to compile this code, I get:
> bad.c:2:16: warning: array subscript has type 'char' [-Wchar-subscripts]
>From there I can look up the documentation of that command line option. But how
could I get from there to your documentation? And, considering an _average_ GCC
user (instead of an active GCC developer), would I have a chance of
understanding the underlying problem and fixing it correctly? The GCC
documentation should at least try to educate the reader a bit.
More information about the Gcc-bugs
mailing list