From d6d7d9de0fa03f3517873e8b7fde93f8fae1b0bc Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 6 Nov 1995 21:54:02 +0000 Subject: Well, Jochen adopted most of my submissions. So only the different style of error reporting (i prefer gcc style to be consistent with the compiler) is left, plus a minor nit he's most likely been overlooking. There are still problems with bootstrapping, and you should expect troubles when linting libc... --- usr.bin/xlint/lint1/err.c | 8 ++++---- usr.bin/xlint/xlint/Makefile | 2 +- usr.bin/xlint/xlint/xlint.c | 7 +++++++ 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index 32c80c4..c2be198 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -399,7 +399,7 @@ verror(n, ap) const char *fn; fn = basename(curr_pos.p_file); - (void)printf("%s(%d): ", fn, curr_pos.p_line); + (void)printf("%s:%d: ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf("\n"); nerr++; @@ -417,7 +417,7 @@ vwarning(n, ap) return; fn = basename(curr_pos.p_file); - (void)printf("%s(%d): warning: ", fn, curr_pos.p_line); + (void)printf("%s:%d: warning: ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf("\n"); } @@ -460,7 +460,7 @@ lerror(msg, va_alist) va_start(ap); #endif fn = basename(curr_pos.p_file); - (void)fprintf(stderr, "%s(%d): lint error: ", fn, curr_pos.p_line); + (void)fprintf(stderr, "%s:%d: lint error: ", fn, curr_pos.p_line); (void)vfprintf(stderr, msg, ap); (void)fprintf(stderr, "\n"); va_end(ap); @@ -505,7 +505,7 @@ message(n, va_alist) va_start(ap); #endif fn = basename(curr_pos.p_file); - (void)printf("%s(%d): ", fn, curr_pos.p_line); + (void)printf("%s:%d: ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf("\n"); va_end(ap); diff --git a/usr.bin/xlint/xlint/Makefile b/usr.bin/xlint/xlint/Makefile index 41c833c..c172fc4 100644 --- a/usr.bin/xlint/xlint/Makefile +++ b/usr.bin/xlint/xlint/Makefile @@ -4,7 +4,7 @@ PROG= xlint SRCS= xlint.c mem.c -MAN= lint.1 +MAN1= lint.1 CFLAGS+=-I${.CURDIR}/../lint1 diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 3e57797..852fd01 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -325,7 +325,12 @@ main(argc, argv) appcstrg(&cppflags, "-$"); appcstrg(&cppflags, "-C"); appcstrg(&cppflags, "-Wcomment"); +#if defined (__FreeBSD__) && (__FreeBSD__ == 2) + appcstrg(&cppflags, "-D__FreeBSD__=2"); +#else +# error "This ain't NetBSD. You lose!" appcstrg(&cppflags, "-D__NetBSD__"); +#endif appcstrg(&cppflags, "-Dlint"); /* XXX don't def. with -s */ appdef(&cppflags, "lint"); appdef(&cppflags, "unix"); @@ -422,7 +427,9 @@ main(argc, argv) freelst(&lcppflgs); appcstrg(&lcppflgs, "-traditional"); appstrg(&lcppflgs, concat2("-D", MACHINE)); +#ifdef MACHINE_ARCH appstrg(&lcppflgs, concat2("-D", MACHINE_ARCH)); +#endif appcstrg(&l1flags, "-t"); appcstrg(&l2flags, "-t"); tflag = 1; -- cgit v1.1