Patch to allow strlen expander to fail

Jamie Lokier jamie.lokier@cern.ch
Mon Mar 6 16:50:00 GMT 2000


Jeffrey A Law wrote:
>   > There was recently a problem with the Linux kernel because gcc
>   > willy-nilly called memcpy(3), and that one isn't around in the kernel,
> Then that's a kernel problem.  They're depending on a specific, undocumented
> and highly implementation dependent behavior in the compiler.  That's dumb.

The problem is that GCC emits out of line calls to memcpy for structure
copies.  Linux provides a perfectly good inline memcpy function, but it
is not used by GCC.

To work around this, people are supposed to use a "struct_cpy" macro
instead of structure assignment.  Ugly, easily forgotten, and not
required for all architectures.  But it works.

-- Jamie


More information about the Gcc mailing list