If I declare a struct with initializer, clang would generate a call to memset, probably to zero out the struct.
But in my kernel, the function should be kmemset, not memset.
I don't want to rename the function to memset, since that will cause conflict in unit test program.
I already added -fno-builtin to CFLAGS, but clang still calls memset. Is there any way to disable that? If I can tell clang to use kmemset would be better.
Code: Select all
// declare a struct with initializer, calls to memset
struct page my_page_desc = { .type = 0 };
// declare a struct without initializer, no call to memset
// I have to use this way, but I don't like it
struct page my_page_desc;
my_page_desc.type = 0;