Subject: lib/28319: lint error when using stdarg.h va_start
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <blymn@baea.com.au>
List: netbsd-bugs
Date: 11/15/2004 11:28:00
>Number:         28319
>Category:       lib
>Synopsis:       lint gives a warning when using va_start from stdarg.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 15 11:28:00 +0000 2004
>Originator:     Brett Lymn (Master of the Siren)
>Release:        NetBSD 2.99.10 (10 Nov 2004)
>Organization:
Brett Lymn
>Environment:
System: NetBSD siren 2.99.10 NetBSD 2.99.10 (SIREN.ACPI.MP) #1: Wed Nov 10 23:15:40 CST 2004 blymn@siren:/usr/src/sys/arch/amd64/compile/SIREN.ACPI.MP amd64
Architecture: x86_64
Machine: amd64
>Description:
	When compiling source that uses va_start from stdarg.h, lint
throws the following warning:

field.c(386): warning: illegal combination of pointer and integer, op = [123]

>How-To-Repeat:
	Lint the sample code given in varargs(3) or any other code that
uses va_start.

>Fix:
	I don't know if this is the correct fix but it suppresses the
lint warning:


Index: stdarg.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/include/stdarg.h,v
retrieving revision 1.3
diff -u -r1.3 stdarg.h
--- stdarg.h	7 Aug 2003 16:26:36 -0000	1.3
+++ stdarg.h	15 Nov 2004 11:19:31 -0000
@@ -41,7 +41,7 @@
 
 #ifdef __lint__
 #define __builtin_next_arg(t)		((t) ? 0 : 0)
-#define	__builtin_stdarg_start(a, l)	((a) = ((l) ? 0 : 0))
+#define	__builtin_stdarg_start(a, l)	((a) = (va_list)((l) ? 0 : 0))
 #define	__builtin_va_arg(a, t)		((a) ? (t) 0 : (t) 0)
 #define	__builtin_va_end(a)		/* nothing */
 #define	__builtin_va_copy(d, s)		((d) = (s))