Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: make target platform independent o...



details:   https://anonhg.NetBSD.org/src/rev/968e5c89ebaa
branches:  trunk
changeset: 949308:968e5c89ebaa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 09 14:10:12 2021 +0000

description:
lint: make target platform independent of host platform

If lint is run on a platform that has CHAR_BIT == 10, this doesn't
magically make an ILP32 platform have 40 bits per uint32_t.

At the moment, all of the supported platforms are either ILP32 or
I32LP64 anyway, and all of them have CHAR_BIT == 8 == CHAR_SIZE,
so nothing changes practically.

diffstat:

 usr.bin/xlint/arch/aarch64/targparam.h   |  10 +++---
 usr.bin/xlint/arch/alpha/targparam.h     |  10 +++---
 usr.bin/xlint/arch/arm/targparam.h       |  10 +++---
 usr.bin/xlint/arch/coldfire/targparam.h  |  10 +++---
 usr.bin/xlint/arch/hppa/targparam.h      |  10 +++---
 usr.bin/xlint/arch/i386/targparam.h      |  10 +++---
 usr.bin/xlint/arch/ia64/targparam.h      |  10 +++---
 usr.bin/xlint/arch/m68000/targparam.h    |  10 +++---
 usr.bin/xlint/arch/m68k/targparam.h      |  10 +++---
 usr.bin/xlint/arch/mips/targparam.h      |  10 +++---
 usr.bin/xlint/arch/mips64/targparam.h    |  10 +++---
 usr.bin/xlint/arch/or1k/targparam.h      |  10 +++---
 usr.bin/xlint/arch/powerpc/targparam.h   |  10 +++---
 usr.bin/xlint/arch/powerpc64/targparam.h |  10 +++---
 usr.bin/xlint/arch/riscv32/targparam.h   |  10 +++---
 usr.bin/xlint/arch/riscv64/targparam.h   |  10 +++---
 usr.bin/xlint/arch/sh3/targparam.h       |  10 +++---
 usr.bin/xlint/arch/sparc/targparam.h     |  10 +++---
 usr.bin/xlint/arch/sparc64/targparam.h   |  10 +++---
 usr.bin/xlint/arch/vax/targparam.h       |  10 +++---
 usr.bin/xlint/arch/x86_64/targparam.h    |  10 +++---
 usr.bin/xlint/common/ilp32.h             |  18 +++++-----
 usr.bin/xlint/common/inittyp.c           |  50 +++++++++++++++++--------------
 usr.bin/xlint/common/lp64.h              |  20 ++++++------
 usr.bin/xlint/lint1/cgram.y              |   6 +-
 usr.bin/xlint/lint1/decl.c               |  18 +++++-----
 usr.bin/xlint/lint1/scan.l               |  16 +++++-----
 usr.bin/xlint/lint1/tree.c               |  26 ++++++++--------
 28 files changed, 184 insertions(+), 180 deletions(-)

diffs (truncated from 906 to 300 lines):

diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/aarch64/targparam.h
--- a/usr.bin/xlint/arch/aarch64/targparam.h    Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/aarch64/targparam.h    Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.2 2021/01/09 13:58:43 rillig Exp $ */
+/* $NetBSD: targparam.h,v 1.3 2021/01/09 14:10:12 rillig Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -45,8 +45,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define INTPTR_IS_LONG         1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (16 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            128
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/alpha/targparam.h
--- a/usr.bin/xlint/arch/alpha/targparam.h      Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/alpha/targparam.h      Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.5 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.6 2021/01/09 14:10:12 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define INTPTR_IS_LONG         1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/arm/targparam.h
--- a/usr.bin/xlint/arch/arm/targparam.h        Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/arm/targparam.h        Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.6 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.7 2021/01/09 14:10:12 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,9 +47,9 @@
 #define        SIZEOF_IS_ULONG         1
 #define        INTPTR_IS_LONG          1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
 /* XXX ARM ELF ABI says packed enums -- variable size! */
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/coldfire/targparam.h
--- a/usr.bin/xlint/arch/coldfire/targparam.h   Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/coldfire/targparam.h   Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.3 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.4 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/hppa/targparam.h
--- a/usr.bin/xlint/arch/hppa/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/hppa/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.6 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.7 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define        INTPTR_IS_LONG          1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/i386/targparam.h
--- a/usr.bin/xlint/arch/i386/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/i386/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.5 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.6 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (12 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            96
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/ia64/targparam.h
--- a/usr.bin/xlint/arch/ia64/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/ia64/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.3 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.4 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define        INTPTR_IS_LONG          1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (16 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            128
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/m68000/targparam.h
--- a/usr.bin/xlint/arch/m68000/targparam.h     Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/m68000/targparam.h     Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.4 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.5 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/m68k/targparam.h
--- a/usr.bin/xlint/arch/m68k/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/m68k/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.5 2021/01/09 13:58:43 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.6 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (12 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            96
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/mips/targparam.h
--- a/usr.bin/xlint/arch/mips/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/mips/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.6 2021/01/09 13:58:44 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.7 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -53,8 +53,8 @@
 #define        INTPTR_IS_LONG          0
 #endif
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/mips64/targparam.h
--- a/usr.bin/xlint/arch/mips64/targparam.h     Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/mips64/targparam.h     Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.6 2021/01/09 13:58:44 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.7 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -48,8 +48,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define        INTPTR_IS_LONG          1
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (16 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            128
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/or1k/targparam.h
--- a/usr.bin/xlint/arch/or1k/targparam.h       Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/or1k/targparam.h       Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.2 2021/01/09 13:58:44 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.3 2021/01/09 14:10:13 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/powerpc/targparam.h
--- a/usr.bin/xlint/arch/powerpc/targparam.h    Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/powerpc/targparam.h    Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.6 2021/01/09 13:58:44 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.7 2021/01/09 14:10:14 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         0
 #define        INTPTR_IS_LONG          0
 
-#define        FLOAT_SIZE              (4 * CHAR_BIT)
-#define        DOUBLE_SIZE             (8 * CHAR_BIT)
-#define        LDOUBLE_SIZE            (8 * CHAR_BIT)
+#define        FLOAT_SIZE              32
+#define        DOUBLE_SIZE             64
+#define        LDOUBLE_SIZE            64
 
-#define        ENUM_SIZE               (4 * CHAR_BIT)
+#define        ENUM_SIZE               32
diff -r 5a11564219c6 -r 968e5c89ebaa usr.bin/xlint/arch/powerpc64/targparam.h
--- a/usr.bin/xlint/arch/powerpc64/targparam.h  Sat Jan 09 14:00:05 2021 +0000
+++ b/usr.bin/xlint/arch/powerpc64/targparam.h  Sat Jan 09 14:10:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targparam.h,v 1.3 2021/01/09 13:58:45 rillig Exp $     */
+/*     $NetBSD: targparam.h,v 1.4 2021/01/09 14:10:14 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -47,8 +47,8 @@
 #define        SIZEOF_IS_ULONG         1
 #define        INTPTR_IS_LONG          1
 



Home | Main Index | Thread Index | Old Index