mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 23:35:00 +08:00
Cast return of strtol to unsigned int
strtol returns long, which is compared against unsigned int. On 32-bit hosts, it leads to gcc/gentarget-def.c: In function void def_target_insn(const char*, const char*): gcc/gentarget-def.c:88:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] This patch casts return of strtol to unsigned int to avoid the error. * gentarget-def.c (def_target_insn): Cast return of strtol to unsigned int. From-SVN: r224993
This commit is contained in:
parent
93c5d1fa35
commit
cf3e518646
@ -1,3 +1,8 @@
|
||||
2015-06-25 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gentarget-def.c (def_target_insn): Cast return of strtol to
|
||||
unsigned int.
|
||||
|
||||
2015-06-25 Andrew MacLeod <amacleod@redhat.com>
|
||||
|
||||
* gimple.h (gimple_call_set_fn): Move inline function.
|
||||
|
@ -85,7 +85,7 @@ def_target_insn (const char *name, const char *prototype)
|
||||
That doesn't contribute to the suffix, so skip ahead and
|
||||
process the following character. */
|
||||
char *endptr;
|
||||
if (strtol (p + 1, &endptr, 10) != opno
|
||||
if ((unsigned int) strtol (p + 1, &endptr, 10) != opno
|
||||
|| (*endptr != ',' && *endptr != ')'))
|
||||
{
|
||||
error ("invalid prototype for '%s'", name);
|
||||
|
Loading…
Reference in New Issue
Block a user