Module Name:    src
Committed By:   christos
Date:           Sat May 23 17:28:27 UTC 2020

Modified Files:
        src/usr.bin/xlint/xlint: lint.1 xlint.c

Log Message:
Use -Z to pass arguments to ccp(1) directly. Can be used as:
    -Z-include -Zfile.h


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/xlint/xlint/lint.1
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/xlint/xlint.c

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/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.39 src/usr.bin/xlint/xlint/lint.1:1.40
--- src/usr.bin/xlint/xlint/lint.1:1.39	Sun Dec 25 06:10:53 2016
+++ src/usr.bin/xlint/xlint/lint.1	Sat May 23 13:28:27 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.39 2016/12/25 11:10:53 wiz Exp $
+.\" $NetBSD: lint.1,v 1.40 2020/05/23 17:28:27 christos Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -30,7 +30,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 24, 2016
+.Dd May 23, 2020
 .Dt LINT 1
 .Os
 .Sh NAME
@@ -51,6 +51,7 @@
 .Op Fl o Ar outputfile
 .Op Fl U Ar name
 .Op Fl X Ar id Ns Op ,id ...
+.Op Fl Z Ar cpparg
 .Ar
 .Nm lint
 .Op Fl abceFgHhprVvwz
@@ -64,6 +65,7 @@
 .Op Fl R Ar old=new
 .Op Fl U Ar name
 .Op Fl X Ar id Ns Op ,id ...
+.Op Fl Z Ar cpparg
 .Ar
 .Sh DESCRIPTION
 .Nm
@@ -413,6 +415,16 @@ A list of messages and ids can be found 
 Report variables referred to by
 .Sy extern
 declarations, but never used.
+.It Fl Z Ar cpparg
+Pass 
+.Ar cpparg
+to 
+.Xr cpp 1
+directly.
+Multiple
+.Fl Z
+.Ar cppargs
+can passed in the order they are received.
 .It Fl z
 Do not complain about structures that are never defined
 (for example, using a structure pointer without knowing

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.49 src/usr.bin/xlint/xlint/xlint.c:1.50
--- src/usr.bin/xlint/xlint/xlint.c:1.49	Sun Feb  9 23:54:01 2020
+++ src/usr.bin/xlint/xlint/xlint.c	Sat May 23 13:28:27 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.49 2020/02/10 04:54:01 christos Exp $ */
+/* $NetBSD: xlint.c,v 1.50 2020/05/23 17:28:27 christos 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.49 2020/02/10 04:54:01 christos Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.50 2020/05/23 17:28:27 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -291,13 +291,13 @@ usage(void)
 
 	(void)fprintf(stderr,
 	    "Usage: %s [-abceghprvwxzHFS] [-s|-t] [-i|-nu] [-Dname[=def]]"
-	    " [-Uname] [-X <id>[,<id>]...\n", getprogname());
+	    " [-Uname] [-X <id>[,<id>]... [-Z <cpparg>]\n", getprogname());
 	(void)fprintf(stderr,
 	    "\t[-Idirectory] [-Ldirectory] [-llibrary] [-ooutputfile]"
 	    " file...\n");
 	(void)fprintf(stderr,
 	    "       %s [-abceghprvwzHFS] [|-s|-t] -Clibrary [-Dname[=def]]\n"
-	    " [-X <id>[,<id>]...\n", getprogname());
+	    " [-X <id>[,<id>]... [-Z <cpparg>]\n", getprogname());
 	(void)fprintf(stderr, "\t[-Idirectory] [-Uname] [-Bpath] [-R old=new]"
 	    " file ...\n");
 	terminate(-1);
@@ -370,7 +370,7 @@ main(int argc, char *argv[])
 	(void)signal(SIGINT, terminate);
 	(void)signal(SIGQUIT, terminate);
 	(void)signal(SIGTERM, terminate);
-	while ((c = getopt(argc, argv, "abcd:eghil:no:prstuvwxzB:C:D:FHI:L:M:PR:SU:VX:")) != -1) {
+	while ((c = getopt(argc, argv, "abcd:eghil:no:prstuvwxzB:C:D:FHI:L:M:PR:SU:VX:Z:")) != -1) {
 		switch (c) {
 
 		case 'a':
@@ -523,6 +523,10 @@ main(int argc, char *argv[])
 			Vflag = 1;
 			break;
 
+		case 'Z':
+			appcstrg(&cflags, optarg);
+			break;
+
 		default:
 			usage();
 			/* NOTREACHED */

Reply via email to