Module Name: src
Committed By: christos
Date: Sun Oct 7 14:20:01 UTC 2018
Modified Files:
src/usr.bin/xlint/common: lp64.h
src/usr.bin/xlint/lint1: scan.l
Log Message:
Disable __int128 checks if we are not building on a 64 bit host (
this is suboptimal, but it is the easiest way).
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/common/lp64.h
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/scan.l
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.5 src/usr.bin/xlint/common/lp64.h:1.6
--- src/usr.bin/xlint/common/lp64.h:1.5 Fri Sep 7 11:16:15 2018
+++ src/usr.bin/xlint/common/lp64.h Sun Oct 7 10:20:01 2018
@@ -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
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.83 src/usr.bin/xlint/lint1/scan.l:1.84
--- src/usr.bin/xlint/lint1/scan.l:1.83 Fri Sep 7 11:16:15 2018
+++ src/usr.bin/xlint/lint1/scan.l Sun Oct 7 10:20:01 2018
@@ -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) */