Disable __int128 checks if we are not building on a 64 bit host (

this is suboptimal, but it is the easiest way).
This commit is contained in:
christos 2018-10-07 14:20:01 +00:00
parent 4ceeb5eaf7
commit a0e7897afd
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lp64.h,v 1.5 2018/09/07 15:16:15 christos Exp $ */
/* $NetBSD: lp64.h,v 1.6 2018/10/07 14:20:01 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -67,6 +67,9 @@
#define TARG_QUAD_MIN ((-TARG_QUAD_MAX) - 1)
#define TARG_UQUAD_MAX ((uint64_t) -1)
#ifndef _LP64
/* XXX on a 32 build for a 64 build host we skip these */
#define TARG_INT128_MAX ((__int128_t) (((__uint128_t) -1) >> 1))
#define TARG_INT128_MIN ((-TARG_INT128_MAX) - 1)
#define TARG_UINT128_MAX ((__uint128_t) -1)
#endif

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: scan.l,v 1.83 2018/09/07 15:16:15 christos Exp $ */
/* $NetBSD: scan.l,v 1.84 2018/10/07 14:20:01 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: scan.l,v 1.83 2018/09/07 15:16:15 christos Exp $");
__RCSID("$NetBSD: scan.l,v 1.84 2018/10/07 14:20:01 christos Exp $");
#endif
#include <stdlib.h>
@ -558,7 +558,7 @@ icon(int base)
char c, *eptr;
tspec_t typ;
int ansiu;
#ifdef INT128_SIZE
#ifdef TARG_INT128_MAX
__uint128_t uq = 0;
static tspec_t contypes[2][4] = {
{ INT, LONG, QUAD, INT128, },
@ -689,17 +689,21 @@ icon(int base)
break;
#ifdef INT128_SIZE
case INT128:
#ifdef TARG_INT128_MAX
if (uq > TARG_INT128_MAX && !tflag) {
typ = UINT128;
if (!sflag)
ansiu = 1;
}
#endif
break;
case UINT128:
#ifdef TARG_INT128_MAX
if (uq > TARG_UINT128_MAX) {
/* integer constant out of range */
warning(252);
}
#endif
break;
#endif
/* LINTED206: (enumeration values not handled in switch) */