ARC: Fix build errors with large constants and C89
authorMaciej W. Rozycki <macro@linux-mips.org>
Thu, 20 Sep 2018 14:49:00 +0000 (15:49 +0100)
committerMaciej W. Rozycki <macro@linux-mips.org>
Thu, 20 Sep 2018 14:49:00 +0000 (15:49 +0100)
commit53b6d6f5b2d8681cc4a061e05fe28ef896900908
treee0b27cf753b9a1e074ec63f1b02d731462372ab2
parented3162adc45291b3de496be25911ebfd39f43a36
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.
gas/ChangeLog
gas/config/tc-arc.c
opcodes/ChangeLog
opcodes/arc-nps400-tbl.h
This page took 0.025882 seconds and 4 git commands to generate.