compiler warnings
Brian J. Tarricone
bjt23 at cornell.edu
Sat Dec 27 02:11:53 CET 2008
On Sat, 27 Dec 2008 00:56:19 +0100 Nick Schermer wrote:
> 2008/12/26 Brian J. Tarricone <bjt23 at cornell.edu>:
> > With -Wignored-qualifiers, the above code will throw a warning on
> > the first assignment. Then you fix it by adding 'const', and then
> > you get an error on the second assignment and realise, oh, crap,
> > I'm not supposed to be modifying that variable. So it's a useful
> > warning, but it just appears that (with gcc 4.3 at least), it's way
> > too "chatty".
>
> Yeah, well I think we should leave it on. It's easy to silence by
> adding a (gchar *) in front of the text (bit ugly tho). It's a pitty
> some warnings are triggered because of incorrect gtk api, but in the
> end we all do this to check _our_ code and, like you said, it is
> useful.
No, my bad -- this particular warning was caused by -Wwrite-strings,
which I noticed in the manpage, but didn't see it in the -Wall or
-Wextra lists, and forgot that I added it myself. Sooooo, we can leave
-Wignored-qualifiers and ditch -Wwrite-strings, which is potentially
useful, but I think expendable.
-b
More information about the Xfce4-dev
mailing list