From owner-freebsd-sparc Thu Apr 25 0:12:50 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id B166637B427; Thu, 25 Apr 2002 00:12:44 -0700 (PDT) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g3P7ChhR159524; Thu, 25 Apr 2002 03:12:43 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20020424192940.B35128@dragon.nuxi.com> References: <20020420194116.A92671@dragon.nuxi.com> <20020422135153.A50570@dragon.nuxi.com> <20020424192940.B35128@dragon.nuxi.com> Date: Thu, 25 Apr 2002 03:12:41 -0400 To: obrien@FreeBSD.ORG From: Garance A Drosihn Subject: Re: hosted-gcc_20020419.tar.bz2 uploaded Cc: sparc64@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org At 7:29 PM -0700 4/24/02, David O'Brien wrote: >On Mon, Apr 22, 2002 at 05:58:56PM -0400, Garance A Drosihn wrote: >> |_ ../ctlinfo.c:231: warning: void format, cjobinfo arg (arg 3) >> |_ ../ctlinfo.c:231: warning: void format, cjprivate arg (arg 4) > > > > If I cast those parameters to (void *) then the warning > > goes away. Is that a change I should make? > >Yes. Okay, Will do. > > |_ ../net.c:278: warning: pointer of type `void *' used in arithmetic >> >> Should va_arg() be changed? > >You (the port) may not be using the proper va_args header. From SUSv2, the only header required is stdarg.h. Here's a sample program to try: = = = begin = = = /* * Gets warnings under sparc64 if compiled via: * cc -pedantic -c check_varg.c * or cc -Wpointer-arith -c check_varg.c * * Will not get warnings if you change the type of 'ap' * from 'va_list' to 'char *'. */ #include int sample(int strm, ...); int sample(int strm, ...) { va_list ap; va_start(ap, strm); va_arg(ap, char *); return (0); } = = = end = = = Some interesting code is in /usr/include/machine/ansi.h: #if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95) #define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ #else #define _BSD_VA_LIST_ char * /* va_list */ #endif /* post GCC 2.95 */ #ifdef __GNUC__ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #endif The sample program will also compile without warnings if you modify ansi.h by adding the lines: #undef _BSD_VA_LIST_ #define _BSD_VA_LIST_ char * after the above section. I was already dropping -pedantic from my compiles, should I just drop -Wpointer-arith too? It looks bsd.sys.mk still includes that if ${WARNS} > 2, so I assume it's still a useful option to specify. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message