-
Notifications
You must be signed in to change notification settings - Fork 403
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
iox-#1280 use proper prototypes in C binding #1281
iox-#1280 use proper prototypes in C binding #1281
Conversation
Declaring a function in C that takes no argument requires "(void)". With strict warning settings, C compilers will issue a warning. Signed-off-by: Erik Boasson <eb@ilities.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eboasson Out of curiosity, do you may have a clue why the apple clang version reports in this case an error and the linux version doesn't.
I recompiled it to see if we may overlooked something in our CI but with:
# clang --version
clang version 13.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
in combination with -Wall -Werror -pedantic -Wextra -Wconversion -Wuninitialized
I do not get any warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is probably required to provide void
in C (but not in C++, where it is equivalent to no type in the argument list). See also https://stackoverflow.com/questions/693788/is-it-better-to-use-c-void-arguments-void-foovoid-or-not-void-foo. I have not tried to find at a source in the C standard yet, but I remember having such an issue a long time ago.
@elfenpiff I suspect it is |
Codecov Report
@@ Coverage Diff @@
## release_2.0 #1281 +/- ##
===============================================
+ Coverage 78.91% 78.98% +0.06%
===============================================
Files 370 370
Lines 14706 14706
Branches 2059 2059
===============================================
+ Hits 11605 11615 +10
+ Misses 2419 2410 -9
+ Partials 682 681 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Declaring a function in C that takes no argument requires "(void)".
With strict warning settings, C compilers will issue a warning.
Fixes #1280
Signed-off-by: Erik Boasson eb@ilities.com
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)Notes for Reviewer
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References