This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47143] warning about const multidimensional array as function parameter
- From: "jsm28 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 1 Jan 2011 12:02:31 +0000
- Subject: [Bug c/47143] warning about const multidimensional array as function parameter
- Auto-submitted: auto-generated
- References: <bug-47143-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47143
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2011-01-01 12:02:28 UTC ---
Not a bug. The function parameters are of type "pointer to array[4] of const
double" because const on an array type applies to the element type,
recursively, and then the outermost array type, only, of a parameter of array
type decays to a pointer, and the arguments passed are of type "pointer to
array[4] of double" after array-to-pointer decay, and the only case where
qualifiers are permitted to be added in assignment, argument passing etc. is
qualifiers on the immediate pointer target, not those nested more deeply.