From 98c3e9696caea47a339012579a0a197bdca8fd41 Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok/asmodai Date: Wed, 7 Jul 2004 07:37:04 +0000 Subject: [PATCH] Add -S flag for C99 support. Taken from: NetBSD, Christos Zoulas --- usr.bin/xlint/xlint/lint.1 | 8 +++++--- usr.bin/xlint/xlint/xlint.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/usr.bin/xlint/xlint/lint.1 b/usr.bin/xlint/xlint/lint.1 index a8c1451434..9d27daf53d 100644 --- a/usr.bin/xlint/xlint/lint.1 +++ b/usr.bin/xlint/xlint/lint.1 @@ -30,7 +30,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/usr.bin/xlint/xlint/lint.1,v 1.8.2.7 2002/06/21 15:30:23 charnier Exp $ -.\" $DragonFly: src/usr.bin/xlint/xlint/lint.1,v 1.2 2003/06/17 04:29:34 dillon Exp $ +.\" $DragonFly: src/usr.bin/xlint/xlint/lint.1,v 1.3 2004/07/07 07:37:04 asmodai Exp $ .\" .Dd August 28, 1994 .Dt LINT 1 @@ -41,8 +41,8 @@ .Sh SYNOPSIS .Bk -words .Nm -.Op Fl abceghprvxzHFV -.Op Fl s | t +.Op Fl abceghprvxzHFSV +.Op Fl s | t | S .Op Fl i | nu .Op Fl D Ar name Ns Op = Ns Ar def .Op Fl U Ar name @@ -243,6 +243,8 @@ With the flag, .Dv __STRICT_ANSI__ is a predefined preprocessor macro. +.Fl S +C9X mode. Currently not fully implemented. .It Fl t Traditional C mode. .Dv __STDC__ diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 7f17861ee8..668d8f02ad 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -31,7 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/xlint/xlint/xlint.c,v 1.8 2000/01/14 09:25:31 sheldonh Exp $ - * $DragonFly: src/usr.bin/xlint/xlint/xlint.c,v 1.6 2004/07/01 01:31:45 hmp Exp $ + * $DragonFly: src/usr.bin/xlint/xlint/xlint.c,v 1.7 2004/07/07 07:37:04 asmodai Exp $ */ #include @@ -91,7 +91,7 @@ static char **libs; static char **libsrchpath; /* flags */ -static int iflag, oflag, Cflag, sflag, tflag, Fflag; +static int iflag, oflag, Cflag, sflag, tflag, Fflag, Sflag; /* print the commands executed to run the stages of compilation */ static int Vflag; @@ -275,10 +275,10 @@ appdef(lstp, def) static void usage() { - (void)printf("lint [-abceghprvxzHF] [-s|-t] [-i|-nu] [-Dname[=def]] [-Uname]\n"); + (void)printf("lint [-abceghprvxzHFS] [-s|-t] [-i|-nu] [-Dname[=def]] [-Uname]\n"); (void)printf(" [-Idirectory] [-Ldirectory] [-llibrary] [-ooutputfile] file ...\n"); (void)printf("\n"); - (void)printf("lint [-abceghprvzHF] [-s|-t] -Clibrary [-Dname[=def]]\n"); + (void)printf("lint [-abceghprvzHFS] [-s|-t] -Clibrary [-Dname[=def]]\n"); (void)printf(" [-Idirectory] [-Uname] file ...\n"); terminate(-1); } @@ -361,7 +361,7 @@ main(argc, argv) argv += optind; optind = 0; - c = getopt(argc, argv, "abceghil:no:prstuvxzC:D:FHI:L:U:V"); + c = getopt(argc, argv, "abceghil:no:prstuvxzC:D:FHI:L:SU:V"); switch (c) { @@ -419,6 +419,12 @@ main(argc, argv) sflag = 1; break; + case 'S': + if (tflag) + usage(); + appcstrg(&l1flags, "-S"); + Sflag = 1; + case 't': if (sflag) usage(); -- 2.41.0