This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Momchil Velikov <velco at fadata dot bg>
- Cc: linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org, linuxppc-dev at lists dot linuxppc dot org
- Date: Wed, 02 Jan 2002 11:29:20 +0100
- Subject: Re: [PATCH] C undefined behavior fix
- References: <87g05py8qq.fsf@fadata.bg>
Momchil Velikov <velco@fadata.bg> writes:
> - strcpy(namep, RELOC("linux,phandle"));
> + memcpy (namep, RELOC("linux,phandle"), sizeof("linux,phandle"));
Doesn't this still trigger undefined behavior, as far as the C
standard is concerned? It's probably a better idea to fix the linker,
so that it performs proper relocation.