Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint * Add header files (ilp32.h and lp64.h) that d...
details: https://anonhg.NetBSD.org/src/rev/33a6c88a94dc
branches: trunk
changeset: 520115:33a6c88a94dc
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Jan 03 04:25:14 2002 +0000
description:
* Add header files (ilp32.h and lp64.h) that describe the two
models of type sizes that we currently support, and include
the appropriate one in each arch's targparam.h.
* Use the type size constants provided by targparam.h in the
type table, rather than using "sizeof(type) * CHAR_BIT" (which
would get the host's type size, not the target's). XXX Not
yet done for floating point types.
* Add a new BITFIELDTYPE lint comment that suppresses illegal
bitfield type errors if the type is an integer type (e.g.
long, long long), and also suppresses non-portable bitfield
type warnings.
diffstat:
usr.bin/xlint/lint1/arch/alpha/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/arm/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/i386/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/m68k/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/mips/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/ns32k/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/powerpc/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/sh3/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/sparc/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/sparc64/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/vax/targparam.h | 4 +-
usr.bin/xlint/lint1/arch/x86_64/targparam.h | 4 +-
usr.bin/xlint/lint1/decl.c | 75 +++++++++++++++++----------
usr.bin/xlint/lint1/externs1.h | 4 +-
usr.bin/xlint/lint1/func.c | 25 ++++++++-
usr.bin/xlint/lint1/ilp32.h | 47 +++++++++++++++++
usr.bin/xlint/lint1/lp64.h | 47 +++++++++++++++++
usr.bin/xlint/lint1/scan.l | 6 +-
usr.bin/xlint/xlint/lint.1 | 5 +-
19 files changed, 212 insertions(+), 45 deletions(-)
diffs (truncated from 593 to 300 lines):
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/alpha/targparam.h
--- a/usr.bin/xlint/lint1/arch/alpha/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/alpha/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:50 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:15 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "lp64.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/arm/targparam.h
--- a/usr.bin/xlint/lint1/arch/arm/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/arm/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.2 2001/10/24 00:42:35 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.3 2002/01/03 04:25:16 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/i386/targparam.h
--- a/usr.bin/xlint/lint1/arch/i386/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/i386/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:50 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:16 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/m68k/targparam.h
--- a/usr.bin/xlint/lint1/arch/m68k/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/m68k/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:50 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:16 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/mips/targparam.h
--- a/usr.bin/xlint/lint1/arch/mips/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/mips/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:51 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:17 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/ns32k/targparam.h
--- a/usr.bin/xlint/lint1/arch/ns32k/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/ns32k/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:51 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:17 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/powerpc/targparam.h
--- a/usr.bin/xlint/lint1/arch/powerpc/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/powerpc/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:51 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:17 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/sh3/targparam.h
--- a/usr.bin/xlint/lint1/arch/sh3/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/sh3/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:51 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:17 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/sparc/targparam.h
--- a/usr.bin/xlint/lint1/arch/sparc/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/sparc/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:52 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:18 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/sparc64/targparam.h
--- a/usr.bin/xlint/lint1/arch/sparc64/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/sparc64/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:52 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:18 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "lp64.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/vax/targparam.h
--- a/usr.bin/xlint/lint1/arch/vax/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/vax/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:52 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:18 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "ilp32.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/arch/x86_64/targparam.h
--- a/usr.bin/xlint/lint1/arch/x86_64/targparam.h Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/arch/x86_64/targparam.h Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:52 thorpej Exp $ */
+/* $NetBSD: targparam.h,v 1.2 2002/01/03 04:25:18 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,6 +35,8 @@
* Machine-dependent target parameters for lint1.
*/
+#include "lp64.h"
+
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
diff -r 70a13fdcd36d -r 33a6c88a94dc usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Thu Jan 03 03:52:14 2002 +0000
+++ b/usr.bin/xlint/lint1/decl.c Thu Jan 03 04:25:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.25 2001/11/21 19:14:25 wiz Exp $ */
+/* $NetBSD: decl.c,v 1.26 2002/01/03 04:25:14 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: decl.c,v 1.25 2001/11/21 19:14:25 wiz Exp $");
+__RCSID("$NetBSD: decl.c,v 1.26 2002/01/03 04:25:14 thorpej Exp $");
#endif
#include <sys/param.h>
@@ -98,37 +98,37 @@
{ UNSIGN, { 0, 0,
SIGNED, UNSIGN,
0, 0, 0, 0, 0, "unsigned" } },
- { CHAR, { CHAR_BIT, CHAR_BIT,
+ { CHAR, { CHAR_SIZE, CHAR_BIT,
SCHAR, UCHAR,
1, 0, 0, 1, 1, "char" } },
- { SCHAR, { CHAR_BIT, CHAR_BIT,
+ { SCHAR, { CHAR_SIZE, CHAR_BIT,
SCHAR, UCHAR,
1, 0, 0, 1, 1, "signed char" } },
- { UCHAR, { CHAR_BIT, CHAR_BIT,
+ { UCHAR, { CHAR_SIZE, CHAR_BIT,
SCHAR, UCHAR,
1, 1, 0, 1, 1, "unsigned char" } },
- { SHORT, { sizeof (short) * CHAR_BIT, 2 * CHAR_BIT,
+ { SHORT, { SHORT_SIZE, 2 * CHAR_BIT,
SHORT, USHORT,
1, 0, 0, 1, 1, "short" } },
- { USHORT, { sizeof (u_short) * CHAR_BIT, 2 * CHAR_BIT,
+ { USHORT, { SHORT_SIZE, 2 * CHAR_BIT,
SHORT, USHORT,
1, 1, 0, 1, 1, "unsigned short" } },
- { INT, { sizeof (int) * CHAR_BIT, 3 * CHAR_BIT,
+ { INT, { INT_SIZE, 3 * CHAR_BIT,
INT, UINT,
1, 0, 0, 1, 1, "int" } },
- { UINT, { sizeof (u_int) * CHAR_BIT, 3 * CHAR_BIT,
+ { UINT, { INT_SIZE, 3 * CHAR_BIT,
INT, UINT,
1, 1, 0, 1, 1, "unsigned int" } },
- { LONG, { sizeof (long) * CHAR_BIT, 4 * CHAR_BIT,
+ { LONG, { LONG_SIZE, 4 * CHAR_BIT,
LONG, ULONG,
1, 0, 0, 1, 1, "long" } },
- { ULONG, { sizeof (u_long) * CHAR_BIT, 4 * CHAR_BIT,
+ { ULONG, { LONG_SIZE, 4 * CHAR_BIT,
LONG, ULONG,
1, 1, 0, 1, 1, "unsigned long" } },
- { QUAD, { sizeof (quad_t) * CHAR_BIT, 8 * CHAR_BIT,
+ { QUAD, { QUAD_SIZE, 8 * CHAR_BIT,
QUAD, UQUAD,
1, 0, 0, 1, 1, "long long" } },
- { UQUAD, { sizeof (u_quad_t) * CHAR_BIT, 8 * CHAR_BIT,
+ { UQUAD, { QUAD_SIZE, 8 * CHAR_BIT,
QUAD, UQUAD,
1, 1, 0, 1, 1, "unsigned long long" } },
{ FLOAT, { sizeof (float) * CHAR_BIT, 4 * CHAR_BIT,
@@ -152,7 +152,7 @@
{ ENUM, { sizeof (int) * CHAR_BIT, 3 * CHAR_BIT,
ENUM, ENUM,
1, 0, 0, 1, 1, "enum" } },
- { PTR, { sizeof (void *) * CHAR_BIT, 4 * CHAR_BIT,
+ { PTR, { PTR_SIZE, 4 * CHAR_BIT,
PTR, PTR,
0, 1, 0, 0, 1, "pointer" } },
{ ARRAY, { -1, -1,
@@ -1067,25 +1067,40 @@
*/
if (t == CHAR || t == UCHAR || t == SCHAR ||
t == SHORT || t == USHORT || t == ENUM) {
- if (sflag) {
- /* bit-field type '%s' invalid in ANSI C */
- warning(273, tyname(tp));
- } else if (pflag) {
Home |
Main Index |
Thread Index |
Old Index