diff options
author | camthesaxman <cameronghall@cox.net> | 2017-10-26 14:59:00 -0500 |
---|---|---|
committer | camthesaxman <cameronghall@cox.net> | 2017-10-26 14:59:00 -0500 |
commit | f05a8ae218d683b2e555a5b6477a6c9bfc829369 (patch) | |
tree | 1fae2e28610befc56b2f8ccef32bf27c2bb113ea /gcc | |
parent | 928b1951972d7ff8c46347b3dce9e254cf6c215c (diff) |
avoid assembler warning when using -fhex-asm
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/final.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c index 87f9641..2eabdae 100755 --- a/gcc/final.c +++ b/gcc/final.c @@ -341,7 +341,17 @@ static struct label_alignment *label_align; static void print_wint(FILE *file, HOST_WIDE_INT value) { - fprintf(file, flag_hex_asm ? HOST_WIDE_INT_PRINT_HEX : HOST_WIDE_INT_PRINT_DEC, value); + const char *fmt = HOST_WIDE_INT_PRINT_DEC; + if (flag_hex_asm) + { + fmt = HOST_WIDE_INT_PRINT_HEX; + if (value < 0) + { + fputc('-', file); + value = -value; + } + } + fprintf(file, fmt, value); } /* Indicate that branch shortening hasn't yet been done. */ |