This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C undefined behavior fix


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]