LWN.net Logo

Glibc change exposing bugs

Glibc change exposing bugs

Posted Nov 13, 2010 1:07 UTC (Sat) by rriggs (subscriber, #11598)
In reply to: Glibc change exposing bugs by neilbrown
Parent article: Glibc change exposing bugs

memmove: safe, fast, verbose function name
memcpy: unsafe, at least as fast as memmove, one less character to type

Which one do you think your average C programmer will choose?

Which one do you think new programmers are taught to use (in schools that still teach C programming)?


(Log in to post comments)

Glibc change exposing bugs

Posted Nov 13, 2010 2:52 UTC (Sat) by neilbrown (subscriber, #359) [Link]

So we can save the world by creating a 'memmv' in glibc which aliases memmove? Brilliant!

Glibc change exposing bugs

Posted Nov 15, 2010 16:43 UTC (Mon) by renox (subscriber, #23785) [Link]

Too late!

And memcpy should also be named as mem_unsafe_copy, but yes if you tell developers to use safe function by default and to optimize only when they can show benchmarks that the optimisation will make a difference, then yes, you'd get probably better software (if a bit slower).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds