https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198
--- Comment #5 from joseph at codesourcery dot com ---
It's not possible for an array type to be qualified, so you need a cast to
avoid the warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198
--- Comment #4 from Gary Funck ---
I realize that this bug has been closed as invalid, thus making the warning
valid.
However, if the warning is valid what can be done to this declaration to avoid
the warning?
const int (*X0)[10] = alloc (10
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198
Marek Polacek changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198
--- Comment #2 from Paul H. Hargrove ---
Both icc (v13.0.1) and pgcc (v12.9-0) agree with gcc (and thus disagree with
clang) on this:
$ cat -n q.c
1
2 typedef unsigned long size_t;
3 extern const void *alloc (size_t);
4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198
--- Comment #1 from joseph at codesourcery dot com ---
Sounds like a Clang bug to me. The type pointed to by "const int (*)[10]"
is "array of 10 const int", which is not a const-qualified type.