gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: char vs. unsigned char


From: Sebastian Reitenbach
Subject: Re: char vs. unsigned char
Date: Fri, 13 Mar 2015 13:18:37 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0



Am 3/12/2015 um 8:11 PM schrieb Riccardo Mottola:
Hi,

a developer question. I got LuserNET working again! another application almost saved from bitrot :)

I get however a lot of warnings about signedess in char*. In several palces data buffers are specified as unsigned char, while in other places data coming from those buffers is used as char*, including when passing to C functions like atoi().

My simple knowledge would say that usually one can just use char* when treating the content as binary or as string. While signeddess matters when numbers are stored.

I converted many buffers and structs. Everything continues to work as far as I can see.

Could someone comment? check my patch at least by skimming over it?

I wonder why these were declared as unsigned as first.

Maybe it's just to be explicit. I.e. PPC is different thant most (all) other platforms with regard what is the default for char *.
I.e. "char *" means "unsigned char" on PPC, where it means "signed char" on everywhere else,
or vice versa, I always tend to mix that up ;)
Being explicit about the signed with regard to char, at least where it matters, makes things work on PPC and others.

Sebastian

Riccardo



_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]