Re: linux/mm.h breaks memset()

David S. Miller (davem@caip.rutgers.edu)
Wed, 18 Oct 1995 18:34:27 -0400


Date: Wed, 18 Oct 1995 15:31:24 -0400 (EDT)
From: Erik Troan <ewt@redhat.com>

#include <linux/mm.h>

main () {
int a;

memset(&a, sizeof(a), 0);
}

---

bash# gcc -o t t.c
/tmp/cca019061.o: In function `main':
t.c:0: undefined reference to `__constant_c_memset'
t.c:0: undefined reference to `__memset'

Does turning on '-O2' make the problem go away? Gcc looks like it
isn't inlining the functions the linker is complaining about, and the
gcc docs explicitly state that inlining isn't guarenteed to occur with
optimizations off.

Later,
David S. Miller
davem@caip.rutgers.edu