#pragma options [no]upconv
Specifies whether the unsigned specification is preserved when integral promotions are performed.
When noupconv is in effect, any unsigned type smaller than an int is converted to int during integral promotions. When upconv is in effect, these types are converted to unsigned int during integral promotions. The promotion rule does not apply to types that are larger than int.
Sign preservation is provided for compatibility with older dialects of C. The ANSI C standard requires value preservation as opposed to sign preservation.
None.
xlc myprogram.c -qupconv
#include <stdio.h>
int main(void) {
unsigned char zero = 0;
if (-1 <zero)
printf(“Value-preserving rules in effect\n”);
else
printf(“Unsignedness-preserving rules in effect\n”);
return 0;
}