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

Replace empty function parameters with void #787

Closed
dcooley opened this issue Oct 10, 2023 · 1 comment · Fixed by #788
Closed

Replace empty function parameters with void #787

dcooley opened this issue Oct 10, 2023 · 1 comment · Fixed by #788

Comments

@dcooley
Copy link

dcooley commented Oct 10, 2023

from: http://port70.net/~nsz/c/c99/n1256.html#6.11.6

The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature.

and this SO answer suggest you should use void in the function parameter definition to explicitly say the function does not take any arguments.

Therefore, should these two functions be changed to use void, as in:

//h3Index.c
int H3_EXPORT(pentagonCount)(void) { return NUM_PENTAGONS; }

//baseCells.c
int H3_EXPORT(res0CellCount)(void) { return NUM_BASE_CELLS; }

isaacbrodsky added a commit to isaacbrodsky/h3 that referenced this issue Oct 10, 2023
isaacbrodsky added a commit to isaacbrodsky/h3 that referenced this issue Oct 10, 2023
@isaacbrodsky
Copy link
Collaborator

Thanks for flagging this. I agree, it looks like they should be defined as (void). I opened a PR, #788 to change that.

isaacbrodsky added a commit that referenced this issue Oct 16, 2023
* explicitly state parameters are `(void)`, #787

* additional cases to mark void

* fix2
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

Successfully merging a pull request may close this issue.

2 participants