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: "rogi at linuxmail dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 1 Jan 2011 13:16:42 +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
--- Comment #3 from Igor <rogi at linuxmail dot org> 2011-01-01 13:16:39 UTC ---
(In reply to comment #1)
> 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.
This was somewhat confusing to me. Did you mean that funcion expects:
pointer to array[4] of const doubles
and I am passing
pointer to const array[4] of doubles
instead?
This really seems pretty much teh same to me.
Correct me if I'm wrong please.