[Warning] Signed mistach for basic datatype.

2013-12-06 Thread Umesh Kalappa
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

Re: [Warning] Signed mistach for basic datatype.

2013-12-06 Thread Andrew Haley
On 12/06/2013 10:41 AM, Umesh Kalappa wrote: I’m bit confused or i'm missing something here . The first of these is implementation-defined behaviour, and the second is (potentially) undefined behaviour. This is more of a generic C question than a GCC question. Andrew.