This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Warning] Signed mistach for basic datatype.


Hi All ,

The below sample caught my attention i.e

int a ;
unsigned int  b;
int func()
{
return a =b;
}
the compiler didn't warn  me about the signed mismatch in the above case.
where as

int *a ;
unsigned int  *b;
int func()
{
a =b;
return *a;
}
compiler warns me as

warning: pointer targets in assignment differ in signedness [-Wpointer-sign]

I’m bit confused or i'm missing something here .

any thoughts ??

Thanks
~Umesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]