From a0e7897afd8ec86f1f26fbcc2f5f75fe6ba7aae2 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 7 Oct 2018 14:20:01 +0000 Subject: [PATCH] Disable __int128 checks if we are not building on a 64 bit host ( this is suboptimal, but it is the easiest way). --- usr.bin/xlint/common/lp64.h | 5 ++++- usr.bin/xlint/lint1/scan.l | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/usr.bin/xlint/common/lp64.h b/usr.bin/xlint/common/lp64.h index 964ebfcef9e2..b514c7bf12be 100644 --- a/usr.bin/xlint/common/lp64.h +++ b/usr.bin/xlint/common/lp64.h @@ -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 diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index 6ba63d61dcf9..e3e2776b694b 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -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 #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 @@ -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) */