On 02/01/2018 01:12 AM, Markus Armbruster wrote: >>> + >>> #include "qemu/osdep.h" >>> +#include <memory.h> >> >> <memory.h> is an obsolete spelling for the now-universal <string.h>. We >> should NEVER need to include it; scripts/clean-includes should be taught >> to blacklist this one. > > "Programming today is a race between software engineers striving to > build bigger and better idiot-proof programs, and the Universe trying to > produce bigger and better idiots. So far, the Universe is winning." > > My point is: if we extended our tooling every time we see a mistake, > we'll drown in tooling. I think we should limit ourselves to *common* > mistakes. Is this one common?
Perhaps not; a tendency when writing a new file is to copy-and-paste a list of includes from another file, then add more if things still don't compile. Since adding memory.h never changes whether compilation will work (unless you forgot osdep.h in the first place, and thereby missed string.h), and if we eradicate all current uses of memory.h, new uses won't have the bad example to copy from. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature