A
Andreas Eibach
Hi,
let's say I have this:
#include <string.h>
#define BLAH "foo"
Later on, I do this:
unsigned char yadda [10];
/* ... get a couple of bytes ( = string) from buffer ... */
if (strcmp (BLAH, yadda) == 0) { printf ("yeehaw!\n"); }
This gives me the following warning:
warning: pointer targets in passing argument 1 of 'strcmp' differ in
signedness
I'm asking because I do not know about signed or unsigned in _quoted_
#define's.
Also several attempts of casting the stuff (both arg#1 + arg#2) failed.
Seems to be a gcc 4-only default to check this.
(I bet this was there in gcc3 also, it was just not enabled by default)
Thanks,
Andreas
let's say I have this:
#include <string.h>
#define BLAH "foo"
Later on, I do this:
unsigned char yadda [10];
/* ... get a couple of bytes ( = string) from buffer ... */
if (strcmp (BLAH, yadda) == 0) { printf ("yeehaw!\n"); }
This gives me the following warning:
warning: pointer targets in passing argument 1 of 'strcmp' differ in
signedness
I'm asking because I do not know about signed or unsigned in _quoted_
#define's.
Also several attempts of casting the stuff (both arg#1 + arg#2) failed.
Seems to be a gcc 4-only default to check this.
(I bet this was there in gcc3 also, it was just not enabled by default)
Thanks,
Andreas