[Bug c/33076] Warning when passing a pointer to a const array to a function that expects a pointer to a non-cast one
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Wed Sep 19 19:54:00 GMT 2007
------- Comment #5 from joseph at codesourcery dot com 2007-09-19 19:54 -------
Subject: Re: Warning when passing a pointer to a const array
to a function that expects a pointer to a non-cast one
On Wed, 19 Sep 2007, jbeulich at novell dot com wrote:
> Isn't this the same as 16602 (which I don't really understand why it was
> rejected as invalid)? Also, if this *is* invalid, then what proper mechanism
> does one have to express what is intended here? And why does similar code
> compile warning free in C++?
Neither C nor C++ have qualified array types, only arrays of qualified
element types, but C++ has different rules from C regarding conversions
involving qualifiers, which allow some conversions (involving arrays or
pointers to pointers) not allowed in C.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33076
More information about the Gcc-bugs
mailing list