[Bug c/62198] spurious warning - initialization discards qualifier from pointer target type for pointer to array

2014-08-21 Thread joseph at codesourcery dot com
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.

[Bug c/62198] spurious warning - initialization discards qualifier from pointer target type for pointer to array

2014-08-20 Thread gary at intrepid dot com
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

[Bug c/62198] spurious warning - initialization discards qualifier from pointer target type for pointer to array

2014-08-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62198 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c/62198] spurious warning - initialization discards qualifier from pointer target type for pointer to array

2014-08-20 Thread PHHargrove at lbl dot gov
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

[Bug c/62198] spurious warning - initialization discards qualifier from pointer target type for pointer to array

2014-08-20 Thread joseph at codesourcery dot com
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.