gnokii-users
[Top][All Lists]
Advanced

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

warning: pointer targets in assignment differ in signedness


From: Dan Oetting
Subject: warning: pointer targets in assignment differ in signedness
Date: Tue, 3 Jan 2006 12:25:56 -0700

Repeated in various forms about 400 times.

There appears to have been a universal conversion of many char * types to unsigned char * but the standard C string libraries still expect char *'s and my compiler is issuing the above warnings as a result. 

I prefer not to disable the warnings because they can help point out real mistakes but so many warnings will burry the ones I really want to see.

The end goal should be to use type char* for character strings and explicit casts where numeric operations are performed. The dilemma is how to convert the existing code to a form that doesn't emit the extra warnings without risking breaking something in the process. My current thought is to use separate temporary typedefs for the char types that are used as strings (CHART and UCHART) to preserve the current tags for signedness until every location that requires an explicit cast is found and fixed. Once the change has been tested both temporary types can be globally converted back to the simple char type.

Using a compiler or lint program that will warn of unsafe (or probably undesired) arithmetic operations on type char will help find those locations the need explicit casts.


-- Dan Oetting <address@hidden>



reply via email to

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