Issue277

Title xlint(1) patch
Priority bug Status resolved
Superseder Nosy List bill.marquette
Assigned To Keywords

Created on 2006-08-03.04:46:04 by bill.marquette, last changed by corecode.

Messages
msg1367 (view) Author: corecode Date: 2006-10-02.13:26:52
Thanks, committed!
msg1183 (view) Author: bill.marquette Date: 2006-09-05.18:04:01
Not sure if this got missed, or if someone was waiting on something
else.  lint doesn't work at all right now w/out this patch.  Also at
http://www.pfsense.org/~billm/dfly/xlint.patch

--Bill

On 8/2/06, Bill Marquette <bill.marquette@gmail.com> wrote:
> Looks like lint won't run with gcc 3 w/out some tweaks.  Here's a
> patch that allows lint to run (noisily) against itself, stolen from
> OpenBSD; probably it ought to be sync'd again from NetBSD where it
> came from, this at least allows it to "do something" again.
>
> --Bill
>
> Index: usr.bin/xlint/xlint/xlint.c
> ===================================================================
> RCS file: /home/dcvs/src/usr.bin/xlint/xlint/xlint.c,v
> retrieving revision 1.11
> diff -u -r1.11 xlint.c
> --- usr.bin/xlint/xlint/xlint.c 5 Apr 2005 08:19:35 -0000       1.11
> +++ usr.bin/xlint/xlint/xlint.c 6 Jul 2006 22:59:29 -0000
> @@ -308,9 +308,19 @@
>         libs = xcalloc(1, sizeof (char *));
>         libsrchpath = xcalloc(1, sizeof (char *));
>
> -       appcstrg(&cppflags, "-lang-c");
> +       appcstrg(&cppflags, "-x");
> +       appcstrg(&cppflags, "c");
> +       appcstrg(&cppflags, "-undef");
> +       /* even with -undef cpp still identifies as GNUC */
> +       appcstrg(&cppflags, "-U__GNUC__");
> +#if defined(__GNUC__)
> +#if __GNUC__ < 3
>         appcstrg(&cppflags, "-$");
>         appcstrg(&cppflags, "-C");
> +#else
> +       appcstrg(&cppflags, "-CC");
> +#endif
> +#endif
>         appcstrg(&cppflags, "-Wcomment");
>  #ifdef __DragonFly__
>         appcstrg(&cppflags, "-D__DragonFly__=" __XSTRING(__DragonFly__));
>
msg1040 (view) Author: bill.marquette Date: 2006-08-03.04:46:02
Looks like lint won't run with gcc 3 w/out some tweaks.  Here's a
patch that allows lint to run (noisily) against itself, stolen from
OpenBSD; probably it ought to be sync'd again from NetBSD where it
came from, this at least allows it to "do something" again.

--Bill

Index: usr.bin/xlint/xlint/xlint.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/xlint/xlint/xlint.c,v
retrieving revision 1.11
diff -u -r1.11 xlint.c
--- usr.bin/xlint/xlint/xlint.c	5 Apr 2005 08:19:35 -0000	1.11
+++ usr.bin/xlint/xlint/xlint.c	6 Jul 2006 22:59:29 -0000
@@ -308,9 +308,19 @@
 	libs = xcalloc(1, sizeof (char *));
 	libsrchpath = xcalloc(1, sizeof (char *));

-	appcstrg(&cppflags, "-lang-c");
+	appcstrg(&cppflags, "-x");
+	appcstrg(&cppflags, "c");
+	appcstrg(&cppflags, "-undef");
+	/* even with -undef cpp still identifies as GNUC */
+	appcstrg(&cppflags, "-U__GNUC__");
+#if defined(__GNUC__)
+#if __GNUC__ < 3
 	appcstrg(&cppflags, "-$");
 	appcstrg(&cppflags, "-C");
+#else
+	appcstrg(&cppflags, "-CC");
+#endif
+#endif
 	appcstrg(&cppflags, "-Wcomment");
 #ifdef __DragonFly__
 	appcstrg(&cppflags, "-D__DragonFly__=" __XSTRING(__DragonFly__));
History
Date User Action Args
2006-10-02 13:26:52corecodesetstatus: chatting -> resolved
messages: + msg1367
2006-10-01 02:12:45adminsetnosy: + bill.marquette
2006-09-05 18:04:05bill.marquettesetstatus: unread -> chatting
messages: + msg1183
2006-08-05 02:52:17justinsetpriority: bug
2006-08-03 04:46:04bill.marquettecreate