This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/33076] Warning when passing a pointer to a const array to a function that expects a pointer to a non-cast one



------- Comment #7 from jozef dot behran at krs dot sk  2007-09-26 12:18 -------
> 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.

And another point: Whether C/C++ have or don't have qualified array types,
still the difference between the "const caca *" and "caca *" types is a "const"
qualifier being applied to some part of the "caca *" base type. Therefore the
types must be compatible when the automatic type conversion involved only adds
"const" qualifiers to the type. Therefore the warnings are not legitimate.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33076


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]