Re: Compiling kannel with -Wall option
"Alexander Malysh" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, IMHO, octet in octstr is always unsigned but when c-string is in play it's char (compiler default). e.g. octstr_create(const char*); char* octstr_get_cstr(Octsr *); but pctstr_create_from_data(unsigned char *,...); What I know is: use unsigned when handling bytes or rwa data and char when handling c-strings or I'm missing something? Am 12.10.2006, 11:36 Uhr, schrieb Andreas Fink <[email protected]>: > We did that once for our own application which is using gwlib. > Its just a lot of hand work and quite a few typecasts. > > One problem spotted while doing that is that gwlib is never sure if an > octet from an octetstring should be considered a signed char or a > unsigned char. My personal view is that it should be considered unsigned > char as we often use raw bytes in octstr. This however means that > whenever you do something like > > debug("xx",0,"This is a string %s",octstr_get_cstr(xyz)); > > you have to typecast it to: > > debug("xx",0,"This is a string %s",(char *)octstr_get_cstr(xyz)); > > > One thing which is new in GCC is that we have now 3 types of chars. > > > char (compiler default signedness) > unsigned char > signed char > > And if the compiler default is signed char, you still get an error when > you assign a signed char to char. > Thats where 99% of the errors come from. > > > On 12.10.2006, at 10:03, Colin Pitrat wrote: > >> Hello, >> I added the -Wall option to CFLAGS, and I add a lot of warnings. I know >> this doesn't mean that there are errors, but it could hide some. Maybe >> it would be nice to enable this flag and to try to correct some of >> these warnings don't you think ? >> >> Regards, >> >> --Colin Pitrat (Bull Services Telco) >> Bull, Architect of an Open World (TM) >> Tél : +33 (0) 1 30 80 72 93 >> www.bull.com >> <colin.pitrat.vcf> > > > -- Thanks, Alex