...
Code Block | ||||
---|---|---|---|---|
| ||||
unsigned long int ulu_a = ULONG_MAX; signed char sc; sc = (signed char)ulu_a; /* cast eliminates warning */ |
...
Code Block | ||||
---|---|---|---|---|
| ||||
unsigned long int ulu_a = ULONG_MAX; signed char sc; if (ulu_a <= SCHAR_MAX) { sc = (signed char)ulu_a; /* use cast to eliminate warning */ } else { /* handle error condition */ } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
signed long int sls_a = LONG_MAX; signed char sc = (signed char)sls_a; /* cast eliminates warning */ |
...
Code Block | ||||
---|---|---|---|---|
| ||||
signed long int sls_a = LONG_MAX; signed char sc; if ( (sls_a < SCHAR_MIN) || (sls_a > SCHAR_MAX) ) { /* handle error condition */ } else { sc = (signed char)sls_a; /* use cast to eliminate warning */ } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
unsigned long int ulu_a = ULONG_MAX; unsigned char uc = (unsigned char)ulu_a; /* cast eliminates warning */ |
...
Code Block | ||||
---|---|---|---|---|
| ||||
unsigned long int ulu_a = ULONG_MAX; unsigned char uc; if (ulu_a > UCHAR_MAX) ) { /* handle error condition */ } else { uc = (unsigned char)ulu_a; /* use cast to eliminate warning */ } |
...