• get compiler warning if unsigned variable is assigned with a signed value
    Can I get a compiler warning if I accidentaly assign a signed int to an unsigned int variable ? eg: unsigned int ui_par = 0 ; signed int si_par = -1 ; Normally I would write something like...
  • get compiler warning if unsigned variable is assigned with a signed value
    Can I get a compiler warning if I accidentaly assign a signed int to an unsigned int variable ? eg: unsigned int ui_par = 0 ; signed int si_par = -1 ; Normally I would write something like...
  • Using unsigned with signed int
    I have a signed integer which I have to assign to an unsigned one after addition with unsigned one. Like int16_t x = -9; uint16_t y = 11; if(x < y) { y = y+x; } How to ensure that...
  • comparing signed and unsigned variables
    In the following code:- char a = 0x80; unsigned char b = 0x80; if(a==0x80) printf("a==0x80\n"); if(b==0x80) printf("b==0x80\n"); The first printf isn't executed but the second is. Why is this...
  • comparing signed and unsigned variables
    In the following code:- char a = 0x80; unsigned char b = 0x80; if(a==0x80) printf("a==0x80\n"); if(b==0x80) printf("b==0x80\n"); The first printf isn't executed but the second is. Why is this...