Date: Fri, 7 Feb 2003 21:56:11 -0800 From: "David O'Brien" <obrien@freebsd.org> To: Chad David <davidc@issci.ca> Cc: current@freebsd.org Subject: Re: minor yacc warnings Message-ID: <20030208055611.GA6765@dragon.nuxi.com> In-Reply-To: <20030204042410.GA31903@colnta.acns.ab.ca> References: <20030204042410.GA31903@colnta.acns.ab.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
The problem with this fix is it depends on a FreeBSD'ism -- "__unused".
One must be able to take a generated parser and run it on non-FreeBSD
systems. -Dlint really should be the way to avoid this warning.
On Mon, Feb 03, 2003 at 09:24:10PM -0700, Chad David wrote:
> We are having minor problems with a newer gcc generating warnings
> for yacc due to yyrcsid not being used. Does anyone object to the
> following patch to skeleton.c or have a better way of handling this?
> -Dlint causes other problems.
>
> Thanks.
>
> --
> Chad David davidc@issci.ca
> www.FreeBSD.org davidc@freebsd.org
> ISSci Inc. Calgary, Alberta Canada
> Index: skeleton.c
> ===================================================================
> RCS file: /mnt1/ncvs/src/usr.bin/yacc/skeleton.c,v
> retrieving revision 1.34
> diff -u -d -r1.34 skeleton.c
> --- skeleton.c 9 Apr 2002 11:39:05 -0000 1.34
> +++ skeleton.c 4 Feb 2003 04:10:14 -0000
> @@ -60,8 +60,9 @@
> const char *banner[] =
> {
> "#ifndef lint",
> + "#include <sys/cdefs.h>",
> "static char const ",
> - "yyrcsid[] = \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.34 2002/04/09 11:39:05 ru Exp $\";",
> + "yyrcsid[] __unused = \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.34 2002/04/09 11:39:05 ru Exp $\";",
> "#endif",
> "#include <stdlib.h>",
> "#define YYBYACC 1",
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030208055611.GA6765>
