Gunnar wrote:
> > > I'm not sure whether chars are meant to be signed or unsigned by
> > > default
> >
> > The compiler is free to choose.
>
> This was a disaster waiting to happen. I think it's time that we
> implement the following policy:
>
> Use "char" for (text) strings but nothing else. Otherwise choose
> the one of "signed char" and "unsigned char" that makes most sense in
> the context. Where signedness is unimportant, use "signed char".
I have more or less completed this conversion, see the patches in ticket
31: http://trac.gnugo.org/gnugo/ticket/31. While doing this, I found
-Wconversion pretty helpful:
`-Wconversion'
Warn if a prototype causes a type conversion that is different
from what would happen to the same argument in the absence of a
prototype. This includes conversions of fixed point to floating
and vice versa, and conversions changing the width or signedness
of a fixed point argument except when the same as the default
promotion.
Also, warn if a negative integer constant expression is implicitly
converted to an unsigned type. For example, warn about the
assignment `x = -1' if `x' is unsigned. But do not warn about
explicit casts like `(unsigned) -1'.
Does anyone see a reason not to set this for GNU Go? (After my changes,
GNU Go again compiles without warnings with -Wconversion included.)
Arend
_______________________________________________
gnugo-devel mailing list
gnugo-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/gnugo-devel