Subject: Re: lint errors about unused functions in header files.
To: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
From: Simon Burge <simonb@netbsd.org>
List: tech-toolchain
Date: 05/10/2000 15:22:54
Bill Sommerfeld wrote:

> > What's the right magic to shut lint up about the following warnings:
> > 
> > 	/usr/include/machine/lock.h(61): warning: static function __cpu_simple_lock_init unused
> > 	/usr/include/machine/lock.h(68): warning: static function __cpu_simple_lock unused
> > 	/usr/include/machine/lock.h(80): warning: static function __cpu_simple_lock_try unused
> > 	/usr/include/machine/lock.h(92): warning: static function __cpu_simple_unlock unused
> 
> Looks like a lint bug to me..  (since our lint is supposed to accept
> gcc extensions..)

Well, not actually a lint bug in the end.  Lint _was_ trying to do the
right thing, but cdefs.h was stripping __inline out so we ended up with
things like:

	static /* delete GCC keyword */  void
	__cpu_simple_lock(__cpu_simple_lock_t *alp)

The following fixes this for me - any hassles with this?

Simon.
--
Index: cdefs.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/cdefs.h,v
retrieving revision 1.31
diff -p -u -r1.31 cdefs.h
--- cdefs.h	2000/02/03 02:20:13	1.31
+++ cdefs.h	2000/05/10 05:11:49
@@ -79,7 +79,9 @@
 #define	__inline	inline		/* convert to C++ keyword */
 #else
 #ifndef __GNUC__
+#ifndef __lint__
 #define	__inline			/* delete GCC keyword */
+#endif /* !__lint__ */
 #endif /* !__GNUC__ */
 #endif /* !__cplusplus */