Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/xlint lint: remove dead code for reading from ...



details:   https://anonhg.NetBSD.org/src/rev/0b696634a904
branches:  trunk
changeset: 1022826:0b696634a904
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 08 15:29:24 2021 +0000

description:
lint: remove dead code for reading from stdin

Since xlint.c 1.27 from 2002-01-31, it has not been possible to read
from stdin anymore.  Apparently nobody missed this feature in the last
19 years.

diffstat:

 usr.bin/xlint/xlint/lint.1  |  18 +-----------------
 usr.bin/xlint/xlint/xlint.c |  15 ++++-----------
 2 files changed, 5 insertions(+), 28 deletions(-)

diffs (90 lines):

diff -r f0e8a6e6dff2 -r 0b696634a904 usr.bin/xlint/xlint/lint.1
--- a/usr.bin/xlint/xlint/lint.1        Sun Aug 08 15:23:42 2021 +0000
+++ b/usr.bin/xlint/xlint/lint.1        Sun Aug 08 15:29:24 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.44 2021/05/02 21:05:42 rillig Exp $
+.\" $NetBSD: lint.1,v 1.45 2021/08/08 15:29:24 rillig Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -167,22 +167,6 @@
 but from one of its included files, the source filename will be
 printed followed by a question mark.
 .Pp
-The special input file name
-.Dq Pa -
-causes
-.Nm
-to take input from standard input (until end of file) and process
-it as if it were a
-.Pa \&.c
-file.
-If the
-.Fl i
-flag is given and
-.Dq Pa -
-is named as one of the input files, the
-.Fl o
-flag must also be specified to provide an output file name.
-.Pp
 .Sy Options
 .Bl -tag -width XoXoutputfileXXX
 .It Fl Ac11
diff -r f0e8a6e6dff2 -r 0b696634a904 usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c       Sun Aug 08 15:23:42 2021 +0000
+++ b/usr.bin/xlint/xlint/xlint.c       Sun Aug 08 15:29:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -634,10 +634,8 @@
        char    **args, *ofn, *pathname;
        const char *CC;
        size_t  len;
-       bool    is_stdin;
        int     fd;
 
-       is_stdin = strcmp(name, "-") == 0;
        bn = lbasename(name, '/');
        suff = lbasename(bn, '.');
 
@@ -648,15 +646,14 @@
                return;
        }
 
-       if (!is_stdin && strcmp(suff, "c") != 0 &&
+       if (strcmp(suff, "c") != 0 &&
            (strncmp(bn, "llib-l", 6) != 0 || bn != suff)) {
                warnx("unknown file type: %s", name);
                return;
        }
 
        if (!iflag || !first)
-               (void)printf("%s:\n",
-                   is_stdin ? "{standard input}" : Fflag ? name : bn);
+               (void)printf("%s:\n", Fflag ? name : bn);
 
        /* build the name of the output file of lint1 */
        if (oflag) {
@@ -664,10 +661,6 @@
                outputfn = NULL;
                oflag = false;
        } else if (iflag) {
-               if (is_stdin) {
-                       warnx("-i not supported without -o for standard input");
-                       return;
-               }
                len = bn == suff ? strlen(bn) : (size_t)((suff - 1) - bn);
                ofn = xasprintf("%.*s.ln", (int)len, bn);
        } else {



Home | Main Index | Thread Index | Old Index