This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: inappropriate warning from const typedef
- To: "Brian St. Pierre" <bstpierre at xiox dot com>
- Subject: Re: inappropriate warning from const typedef
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Fri, 30 Jul 1999 10:16:05 +0100
- CC: egcs-bugs <egcs-bugs at egcs dot cygnus dot com>
- Organization: University of Bristol
- References: <003701bed9f5$facb1260$9901a8c0@bstpierre2.xiox.com>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
"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