[lkml]   [2002]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] C undefined behavior fix
    On Thu, Jan 03, 2002 at 12:35:30AM +0000, David Woodhouse wrote:
    > (cc list trimmed)
    > said:
    > > If you want a strcpy that isnt strcpy then change its name or use a
    > > different language 8)
    > The former is not necessarily sufficient in this case. You've still done the
    > broken pointer arithmetic, so even if the function isn't called strcpy() the
    > compiler is _still_ entitled to replace it with a call to memcpy() or even
    > machine_restart() before sleeping with your mother and starting WW III.

    No, that's not true. We're passing a pointer as an argument. It is a
    valid pointer - dereferencing it may not be valid, but the pointer is
    perfectly legal! There is nothing wrong with this case. The problem
    lies in calling a function whose name is special to GCC and to the C
    language, which GCC can then transform.

    Daniel Jacobowitz Carnegie Mellon University
    MontaVista Software Debian GNU/Linux Developer
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:15    [W:0.025 / U:23.960 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site