...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <limits.h> void func(signed long s_a) { signed long result; if (s_a == INTLONG_MIN) { /* Handle error */ } else { result = -s_a; } /* ... */ } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <limits.h> void func(signed long si_a, signed long si_b) { signed long result; if ((si_a < 0) || (si_b < 0) || (si_b >= UWIDTH(signed long, ULONG_MAX)) || (si_a > (INTLONG_MAX >> si_b))) { /* Handle error */ } else { result = si1 << si2; } /* ... */ } |
...