Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 1996 23:41:48 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-current@FreeBSD.org (FreeBSD-current users)
Subject:   Re: lint
Message-ID:  <199603242241.XAA06456@uriah.heep.sax.de>
In-Reply-To: <199603241953.TAA01226@originat.demon.co.uk> from "Paul Richards" at Mar 24, 96 07:53:39 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Paul Richards wrote:

> I've enabled lint. There's a lot to do to make it useable since FreeBSD
> isn't very lint clean. /* LONGLONG */ needs to be added to a lot of
> headers and there's a bit of a problem with the htonl macro since it
> makes lint abort with a syntax error. Doesn't make lint very usefull
> on real programs.

(There are more things to care for, see my reply to your commit mail.)

Here's my previous fix for the [hn]to[nh][sl] problem.  I'm not sure
if it's totally correct, but it used to work.

Btw., once all the libs are lintable, we should enable the lint target
in the Makefiles.  If i understood it right, this will cause a lint
run for each compilation.

Index: sys/i386/include/endian.h
===================================================================
RCS file: /home/cvs/src/sys/i386/include/endian.h,v
retrieving revision 1.6
diff -u -r1.6 endian.h
--- endian.h	1995/02/12 08:31:31	1.6
+++ endian.h	1995/10/15 13:22:40
@@ -107,14 +107,24 @@
 
 #else
 
+#ifndef lint
 #define	ntohl	__byte_swap_long
 #define	ntohs	__byte_swap_word
 #define	htonl	__byte_swap_long
 #define	htons	__byte_swap_word
+#else /* lint */
+__BEGIN_DECLS
+unsigned long	ntohl __P((unsigned long));
+unsigned short	ntohs __P((unsigned short));
+unsigned long	htonl __P((unsigned long));
+unsigned short	htons __P((unsigned short));
+__END_DECLS
+#endif /* lint */
+
+#define	NTOHL(x)	(x) = ntohl((unsigned long)x)
+#define	NTOHS(x)	(x) = ntohs((unsigned short)x)
+#define	HTONL(x)	(x) = htonl((unsigned long)x)
+#define	HTONS(x)	(x) = htons((unsigned short)x)
 
-#define	NTOHL(x)	(x) = ntohl((u_long)x)
-#define	NTOHS(x)	(x) = ntohs((u_short)x)
-#define	HTONL(x)	(x) = htonl((u_long)x)
-#define	HTONS(x)	(x) = htons((u_short)x)
 #endif
 #endif /* _MACHINE_ENDIAN_H_ */


-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603242241.XAA06456>