[Nut-upsdev] gcc4 compiler warnings
Niklas Edmundsson
nikke at acc.umu.se
Fri Feb 10 14:56:46 UTC 2006
On Fri, 10 Feb 2006, Arjen de Korte wrote:
> I'd prefer switching to unsigned char in the long run and (explicit)
> typecasting to signed char where needed/appropriate/not harmful. In case
> you're using string operations, this will be required. Probably defining
> new functions which use unsigned char and using inline macro's to mimic
> the old ones is doable, but I'd rather see that all drivers are converted
> to use unsigned chars and only typecast to char where string operations
> are involved (and where it is guaranteed not to cause problems).
On a side note: The signedness of char differs betweeen OS's. On some,
char's are signed and on some char's are unsigned. If you really
depend on the signedness to be what you expect, use signed char or
unsigned char...
So, if you force stuff to be either signed or unsigned you'll probably
get warnings when using strcmp et al on architectures that are
different from the one the developer used.
That means that whatever is decided upon should take this into
consideration.
/Nikke
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se | nikke at acc.umu.se
---------------------------------------------------------------------------
If little else, the brain is an educational toy.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
More information about the Nut-upsdev
mailing list