From owner-cvs-all Fri Feb 7 22:47:42 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AF8337B401; Fri, 7 Feb 2003 22:47:39 -0800 (PST) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 481F443FCB; Fri, 7 Feb 2003 22:47:38 -0800 (PST) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.6/8.12.2) with ESMTP id h186lb8X007642; Fri, 7 Feb 2003 22:47:37 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.6/8.12.6/Submit) id h186kLhZ007618; Fri, 7 Feb 2003 22:46:21 -0800 (PST) Date: Fri, 7 Feb 2003 22:46:21 -0800 From: "David O'Brien" To: Alfred Perlstein Cc: Chad David , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, legacy-committers@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/yacc skeleton.c Message-ID: <20030208064621.GA7566@dragon.nuxi.com> Reply-To: obrien@FreeBSD.org References: <200302070339.h173dRvU071460@repoman.freebsd.org> <20030208062131.GA7362@dragon.nuxi.com> <20030208063406.GG88781@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030208063406.GG88781@elvis.mu.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Feb 07, 2003 at 10:34:06PM -0800, Alfred Perlstein wrote: > * David O'Brien [030207 22:23] wrote: > > On Thu, Feb 06, 2003 at 07:39:27PM -0800, Chad David wrote: > > > davidc 2003/02/06 19:39:27 PST > > > > > > Modified files: > > > usr.bin/yacc skeleton.c > > > Log: > > > Add __unused to the declaration of yyrcsid. > > > > > > Revision Changes Path > > > 1.35 +2 -1 src/usr.bin/yacc/skeleton.c > > > http://cvsweb.freebsd.org/src/usr.bin/yacc/skeleton.c.diff?r1=1.34&r2=1.35 > > > > Please back this out. Non-portable parsers are now produced. Not every > > OS has , nor do they understand "__unused". > > How about taking the time to offer advice that will gain us forward > progress? Chad wants to get rid of warnings from the code produced, > perhaps if he added #ifdef __FreeBSD__ or something to the generated > output? Use "gcc -Dlint". You can't use __FreeBSD__ as that covers all versions of FreeBSD. You can't use __FreeBSD_version as that requires one to include , which you can't assume exists. You could use: #ifndef lint #if (defined(__unix__) || defined(unix)) && !defined(USG) #include #endif #if defined(__FreeBSD_version) && __FreeBSD_version >= ????? #include static char const yyrcsid[] __unused = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.35 2003/02/07 03:39:27 davidc Exp $"; #else static char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.35 2003/02/07 03:39:27 davidc Exp $"; #endif #endif but this gets very ugly very quickly. There is not good fix other than to just use -Dlint. I thought this was oblivious enough that I wouldn't had to have taking so much time expounding on the problem that I didn't create. If I had know of an easy fix I would have mentioned it. If one really, really must do something about this, add a new switch to Yacc telling it you want to target only FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message