This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: jtv <jtv at xs4all dot nl>
- To: Richard Henderson <rth at redhat dot com>, Tom Rini <trini at kernel dot crashing dot org>, Momchil Velikov <velco at fadata dot bg>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org, linuxppc-dev at lists dot linuxppc dot org, Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>, Paul Mackerras <paulus at samba dot org>, Benjamin Herrenschmidt <benh at kernel dot crashing dot org>, Corey Minyard <minyard at acm dot org>
- Date: Thu, 3 Jan 2002 01:20:04 +0100
- Subject: Re: [PATCH] C undefined behavior fix
- References: <87g05py8qq.fsf@fadata.bg> <20020102190910.GG1803@cpe-24-221-152-185.az.sprintbbd.net> <20020102133632.C10362@redhat.com> <20020102220548.GL1803@cpe-24-221-152-185.az.sprintbbd.net> <20020102232320.A19933@xs4all.nl> <20020102231243.GO1803@cpe-24-221-152-185.az.sprintbbd.net> <20020103004514.B19933@xs4all.nl> <20020103000118.GR1803@cpe-24-221-152-185.az.sprintbbd.net> <20020102160739.A10659@redhat.com>
On Wed, Jan 02, 2002 at 04:07:39PM -0800, Richard Henderson wrote:
> On Wed, Jan 02, 2002 at 05:01:18PM -0700, Tom Rini wrote:
> > Yes, but doesn't -ffreestanding imply that gcc _can't_ assume this is
> > the standard library...
>
> Ignore strcpy. Yes, that's what visibly causing a failure here,
> but the bug is in the funny pointer arithmetic. Leave that in
> there and the compiler _will_ bite your ass sooner or later.
Thank you for taking it all and putting it in a nutshell.
Jeroen