This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Warning] Signed mistach for basic datatype.
- From: Umesh Kalappa <umesh dot kalappa0 at gmail dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: "cfe-dev at cs dot uiuc dot edu Developers" <cfe-dev at cs dot uiuc dot edu>
- Date: Fri, 6 Dec 2013 16:11:00 +0530
- Subject: [Warning] Signed mistach for basic datatype.
- Authentication-results: sourceware.org; auth=none
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