[PATCH] C undefined behavior fix

Florian Weimer fw@deneb.enyo.de
Wed Jan 2 02:32:00 GMT 2002


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.



More information about the Gcc mailing list