aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2018-09-20 15:49:00 +0100
committerMaciej W. Rozycki <macro@linux-mips.org>2018-09-20 15:49:00 +0100
commit53b6d6f5b2d8681cc4a061e05fe28ef896900908 (patch)
treee0b27cf753b9a1e074ec63f1b02d731462372ab2 /gas/config
parented3162adc45291b3de496be25911ebfd39f43a36 (diff)
downloadbinutils-53b6d6f5b2d8681cc4a061e05fe28ef896900908.zip
binutils-53b6d6f5b2d8681cc4a061e05fe28ef896900908.tar.gz
binutils-53b6d6f5b2d8681cc4a061e05fe28ef896900908.tar.bz2
ARC: Fix build errors with large constants and C89
Fix build errors: cc1: warnings being treated as errors In file included from .../opcodes/arc-opc.c:2630: .../opcodes/arc-nps400-tbl.h:38: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:38: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:41: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:41: warning: integer constant is too large for 'long' type [...] .../opcodes/arc-nps400-tbl.h:712: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:712: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:715: warning: integer constant is too large for 'long' type .../opcodes/arc-nps400-tbl.h:715: warning: integer constant is too large for 'long' type make[4]: *** [arc-opc.lo] Error 1 and: cc1: warnings being treated as errors .../gas/config/tc-arc.c: In function 'md_number_to_chars_midend': .../gas/config/tc-arc.c:802: warning: integer constant is too large for 'long' type .../gas/config/tc-arc.c:810: warning: integer constant is too large for 'long' type make[4]: *** [config/tc-arc.o] Error 1 observed with GCC 4.1.2 and presumably other C89 compilers with the `arc-elf' and `arc-linux-gnu' targets, caused by the use of constants the values of which are outside the range of the `int' type (or the `long' type if it is of the same with). In the C89 language standard such constants are not implicitly converted to a wider type and an explicit suffix is required for such constants. Add a `ull' suffix then as with such constants used in other ports. gas/ * config/tc-arc.c (md_number_to_chars_midend): Append `ull' to large constants. opcodes/ * arc-nps400-tbl.h: Append `ull' to large constants throughout.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 6f0407b..a9b3f1a 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -799,7 +799,7 @@ md_number_to_chars_midend (char *buf, unsigned long long val, int n)
md_number_to_chars (buf, val, n);
break;
case 6:
- md_number_to_chars (buf, (val & 0xffff00000000) >> 32, 2);
+ md_number_to_chars (buf, (val & 0xffff00000000ull) >> 32, 2);
md_number_to_chars_midend (buf + 2, (val & 0xffffffff), 4);
break;
case 4:
@@ -807,7 +807,7 @@ md_number_to_chars_midend (char *buf, unsigned long long val, int n)
md_number_to_chars (buf + 2, (val & 0xffff), 2);
break;
case 8:
- md_number_to_chars_midend (buf, (val & 0xffffffff00000000) >> 32, 4);
+ md_number_to_chars_midend (buf, (val & 0xffffffff00000000ull) >> 32, 4);
md_number_to_chars_midend (buf + 4, (val & 0xffffffff), 4);
break;
default: