mlibc
mlibc copied to clipboard
Parameter names should be present in headers
void *memmem(const void *, size_t, const void *, size_t);
->
void *memmem(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len);
This is extremely useful for tooling like clangd, and should provide no downsides.
The issue with this is that this breaks if a program does #define haystack my_global_state->current_haystack or similar.
We would need to prefix these with double underscores, which would be quite ugly.
hmm, do any programs do this in practice? I don't think I've seen it happen personally (though I imagine glibc does __haystack for a reason), at least before including libc headers? and while that might be potentially ugly, it is quite a useful tool