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]

Re: inappropriate warning from const typedef


"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


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