summaryrefslogtreecommitdiff
path: root/usr.bin/xlint/lint2
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2006-05-29 20:47:23 +0000
committerChad Loder <cloder@cvs.openbsd.org>2006-05-29 20:47:23 +0000
commit9f6721495fde3b6d8da1d395befd8d55482e4413 (patch)
tree9f9319f7b259b9150c3896e618eb7f149e13e456 /usr.bin/xlint/lint2
parenta6e5a47fb2105d4f4fb8bab4c391f6928c937c72 (diff)
Get rid of -t (traditional C) option. Some corrections by moritz.
Diffstat (limited to 'usr.bin/xlint/lint2')
-rw-r--r--usr.bin/xlint/lint2/chk.c33
-rw-r--r--usr.bin/xlint/lint2/externs2.h3
-rw-r--r--usr.bin/xlint/lint2/main2.c9
3 files changed, 17 insertions, 28 deletions
diff --git a/usr.bin/xlint/lint2/chk.c b/usr.bin/xlint/lint2/chk.c
index fe9bc37d30f..23b7bfb1a10 100644
--- a/usr.bin/xlint/lint2/chk.c
+++ b/usr.bin/xlint/lint2/chk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chk.c,v 1.13 2006/04/25 01:25:41 cloder Exp $ */
+/* $OpenBSD: chk.c,v 1.14 2006/05/29 20:47:22 cloder Exp $ */
/* $NetBSD: chk.c,v 1.2 1995/07/03 21:24:42 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: chk.c,v 1.13 2006/04/25 01:25:41 cloder Exp $";
+static char rcsid[] = "$OpenBSD: chk.c,v 1.14 2006/05/29 20:47:22 cloder Exp $";
#endif
#include <stdlib.h>
@@ -595,12 +595,12 @@ chkau(hte_t *hte, int n, sym_t *def, sym_t *decl, pos_t *pos1p,
} else if (t1 == CHAR || t1 == SCHAR) {
t1 = INT;
} else if (t1 == UCHAR) {
- t1 = tflag ? UINT : INT;
+ t1 = INT;
} else if (t1 == SHORT) {
t1 = INT;
} else if (t1 == USHORT) {
/* CONSTCOND */
- t1 = INT_MAX < USHRT_MAX || tflag ? UINT : INT;
+ t1 = INT_MAX < USHRT_MAX ? UINT : INT;
}
}
@@ -842,8 +842,8 @@ printflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
inconarg(hte, call, n);
}
} else if (fc == 'D' || fc == 'O' || fc == 'U') {
- if ((alt && fc != 'O') || sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ /* DOU are deprecated */
+ badfmt(hte, call);
sz = LONG;
if (fc == 'D') {
goto int_conv;
@@ -1000,13 +1000,11 @@ scanflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
}
goto conv;
} else if (fc == 'D') {
- if (sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ badfmt(hte, call);
sz = LONG;
goto conv;
} else if (fc == 'O') {
- if (sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ badfmt(hte, call);
sz = ULONG;
goto conv;
} else if (fc == 'X') {
@@ -1014,8 +1012,7 @@ scanflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
* XXX valid in ANSI C, but in NetBSD's libc imple-
* mented as "lx". Thats why it should be avoided.
*/
- if (sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ badfmt(hte, call);
sz = ULONG;
goto conv;
} else if (fc == 'E') {
@@ -1023,14 +1020,12 @@ scanflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
* XXX valid in ANSI C, but in NetBSD's libc imple-
* mented as "lf". Thats why it should be avoided.
*/
- if (sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ badfmt(hte, call);
sz = DOUBLE;
goto conv;
} else if (fc == 'F') {
/* XXX only for backward compatibility */
- if (sz != NOTSPEC || !tflag)
- badfmt(hte, call);
+ badfmt(hte, call);
sz = DOUBLE;
goto conv;
} else if (fc == 'G') {
@@ -1273,12 +1268,12 @@ eqtype(type_t *tp1, type_t *tp2, int ignqual, int promot, int asgn, int *warn)
} else if (t == CHAR || t == SCHAR) {
t = INT;
} else if (t == UCHAR) {
- t = tflag ? UINT : INT;
+ t = INT;
} else if (t == SHORT) {
t = INT;
} else if (t == USHORT) {
/* CONSTCOND */
- t = INT_MAX < USHRT_MAX || tflag ? UINT : INT;
+ t = INT_MAX < USHRT_MAX ? UINT : INT;
}
}
@@ -1318,7 +1313,7 @@ eqtype(type_t *tp1, type_t *tp2, int ignqual, int promot, int asgn, int *warn)
return (0);
if (!tp1->t_volatile && tp2->t_volatile)
return (0);
- } else if (!ignqual && !tflag) {
+ } else if (!ignqual) {
if (tp1->t_const != tp2->t_const)
return (0);
if (tp1->t_const != tp2->t_const)
diff --git a/usr.bin/xlint/lint2/externs2.h b/usr.bin/xlint/lint2/externs2.h
index 1b6a97f5fc0..0e54ce8dabe 100644
--- a/usr.bin/xlint/lint2/externs2.h
+++ b/usr.bin/xlint/lint2/externs2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: externs2.h,v 1.5 2005/12/01 05:06:40 cloder Exp $ */
+/* $OpenBSD: externs2.h,v 1.6 2006/05/29 20:47:22 cloder Exp $ */
/* $NetBSD: externs2.h,v 1.2 1995/07/03 21:24:46 cgd Exp $ */
/*
@@ -41,7 +41,6 @@ extern int Cflag;
extern const char *libname;
extern int pflag;
extern int sflag;
-extern int tflag;
extern int Hflag;
extern int hflag;
extern int Fflag;
diff --git a/usr.bin/xlint/lint2/main2.c b/usr.bin/xlint/lint2/main2.c
index 20e272d1b5e..6db5895a93a 100644
--- a/usr.bin/xlint/lint2/main2.c
+++ b/usr.bin/xlint/lint2/main2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main2.c,v 1.8 2005/11/23 18:21:44 deraadt Exp $ */
+/* $OpenBSD: main2.c,v 1.9 2006/05/29 20:47:22 cloder Exp $ */
/* $NetBSD: main2.c,v 1.2 1995/07/03 21:24:53 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: main2.c,v 1.8 2005/11/23 18:21:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main2.c,v 1.9 2006/05/29 20:47:22 cloder Exp $";
#endif
#include <stdio.h>
@@ -64,8 +64,6 @@ int pflag;
*/
int sflag;
-int tflag;
-
/*
* If a complaint stems from a included file, print the name of the included
* file instead of the name spezified at the command line followed by '?'
@@ -102,9 +100,6 @@ main(int argc, char *argv[])
case 's':
sflag = 1;
break;
- case 't':
- tflag = 1;
- break;
case 'u':
uflag = 0;
break;