gcc4 compile fixes in bugzilla.gnome #162582

Christian Stimming stimming at tuhh.de
Fri Dec 31 11:32:32 EST 2004


Am Freitag, 31. Dezember 2004 00:51 schrieb John Ellson:
> Derek Atkins wrote:
> >John Ellson <ellson at research.att.com> writes:
> >>The majority of the casts were fixing the use of unsigned char
> >>(xmlChar) for libxml2
> >>routines versus signed char (char and gchar) in routines like strcmp.
> >
> >Perhaps there's a gcc4-specific compiler option to turn off those
> >warnings that are new-in-gcc4?
>
> Perhaps, but ignoring the warnings is no better than hiding them with
> casts, imho.

However, the casts will hide much more general problems than these warnings -- 
if there is a cast of something to a (char*), then that something could very 
well have been something completely different. I would therefore agree with 
Derek that such a warning should rather be switched off when using gcc4. IMHO 
having casts between char/gchar/xmlChar would rather introduce a too high 
probability of hiding actual casting errors, compared to these gcc4 warnings.

Christian

>
> The same warning did catch another problem, the use of gint instead of
> guint.
>
> In my opinion, the real problem is the multiple flavors of char
> (char/gchar/xmlChar)
> for the same thing: a code for a character, where the codes are not
> intrinsically signed or unsigned;
> they are just 8bit values use to differentiate one character from another.
>
>
> John
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel



More information about the gnucash-devel mailing list