This is the mail archive of the gcc@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]

Re: Warning on cast to const


clifford@clifford.at writes:

> maybe I am wrong, but in my understanding an implicit cast from non-const
> to const should never produce a warning (and usually does not), but:
>
> root@murphy:~# cat demo.c
> void func(const char **p) { }
> int main() {
>         const char **demo1=0;
>         char **demo2=0;
>         func(demo1);
>         func(demo2);
> }
>
> root@murphy:~# gcc-x demo.c
> demo.c: In function `main':
> demo.c:6: warning: passing arg 1 of `func' from incompatible pointer type

See http://gcc.gnu.org/ml/gcc-bugs/2000-05/msg00502.html

-- 
	Falk


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