I have a function as follows that processes the information contained in an array of type unsigned char:
unsigned char LRCsimple(unsigned char *p, createLRC , unsigned char length)
{
}
Works great for mostly unsigned char arrays.
Now, I have a signed array and when I use such a function and it works very well, but I have a warning when compiling the code:
> ../src/apptcpipserver.c:102:9: warning: pointer targets in passing argument 1 of 'LRCsimple' differ in signedness [-Wpointer-sign]
if (0x01 == LRCsimple(apptcpipserverData.cRxedData,0x00,(apptcpipserverData.cRxedData[0x02] - 0x02)))
If I want to avoid this warning, I think the optimal solution is to create a function similar to the one above, but for a signed array, as follows:
unsigned char signedLRCsimple(char *p, createLRC , unsigned char length)
{
}
Or is there something else I can do to avoid that warning message?
void *orconst void *. Internally, the routine would convert the pointer tounsigned char *orconst unsigned char *to work with it…inttypes, as characters in a character set, as floating-point data, and so on, then it generally ought to take the data as a pointer to its actual type.