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

Add "const" modifier to "char *" parameters that don't modify it #65

Open
tarruda opened this issue Feb 15, 2022 · 2 comments
Open

Add "const" modifier to "char *" parameters that don't modify it #65

tarruda opened this issue Feb 15, 2022 · 2 comments

Comments

@tarruda
Copy link
Contributor

tarruda commented Feb 15, 2022

Functions that create/modify metrics don't modify their char * parameters, so it would be good to add const modifier to let the compiler know callers don't expect it to be modified.

@edsiper
Copy link
Member

edsiper commented Mar 1, 2022

used to be a practice, but at the moment that might trigger lot of warnings in Fluent Bit caller

@fredrik-jansson-se
Copy link

Integrating with cmetrics from rust (bindgen), and it would had been great with const modifers. As of now I have to jump through hoops to pass c-strings to functions that could take const char*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants