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]

Re: Patch to allow strlen expander to fail


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

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