inappropriate warning from const typedef

Nathan Sidwell nathan@acm.org
Sat Jul 31 23:33:00 GMT 1999


"Brian St. Pierre" wrote:

> d by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
> const-cpp.cpp: In function `int compare2(const char *, const char *)':
> const-cpp.cpp:22: warning: passing `const char *' as argument 1 of
> `isSame2(char
>  *, char *)' discards const
> const-cpp.cpp:22: warning: passing `const char *' as argument 2 of
> `isSame2(char
>  *, char *)' discards const
cygwin32\bin\as.exe -o objconst-cpp.o const-cpp.s
> 
> The warnings are inappropriate because isSame2() accepts constString2 args,
> which is typedef-ed to be 'const'.  The warnings go away if a second
> (redundant) const is inserted into the prototype (see the third case).
thanks for the report. The current snapshot compiles it fine, I beleive the fix
is in the forthcoming 2.95

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk



More information about the Gcc-bugs mailing list