Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter names should be present in headers #526

Open
ArsenArsen opened this issue Jun 21, 2022 · 3 comments
Open

Parameter names should be present in headers #526

ArsenArsen opened this issue Jun 21, 2022 · 3 comments
Labels
enhancement trivial issue Requires only straightforward changes and not new logic.

Comments

@ArsenArsen
Copy link
Member

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.

@ArsenArsen ArsenArsen added enhancement trivial issue Requires only straightforward changes and not new logic. labels Jun 21, 2022
@avdgrinten
Copy link
Member

The issue with this is that this breaks if a program does #define haystack my_global_state->current_haystack or similar.

@avdgrinten
Copy link
Member

We would need to prefix these with double underscores, which would be quite ugly.

@ArsenArsen
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement trivial issue Requires only straightforward changes and not new logic.
Projects
None yet
Development

No branches or pull requests

2 participants