-
Notifications
You must be signed in to change notification settings - Fork 626
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
Various warnings fixes #3840
Various warnings fixes #3840
Conversation
Admittedly some of them were already fine because they were the definition, and had a proper declaration already, but fix them as well to be clear and consistent.
GCC's -Wold-style-declaration.
This is not super useful as it's not commonly called, but it allows the compiler to check the calls to the error printer.
Those are trailing semicolons in macros expanding to function definitions, but ISO C doesn't like that -- although compilers usually don't care.
This prevents GCC from warning this is an infinite recursion loop, as well as pointing out the intent of that function.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3840 +/- ##
=======================================
Coverage 85.05% 85.05%
=======================================
Files 228 228
Lines 53982 53982
=======================================
+ Hits 45914 45915 +1
+ Misses 8068 8067 -1
☔ View full report in Codecov by Sentry. |
The extra semicolons help the indentation engine of editors and source code indexes like ctags.
|
@masatake Hum, OK… so maybe it's easiest not to care about this specific issue? It's not like it's likely to cause an issue, and not everybody is building with If you like your solution enough, we could indeed do it, but use If you do like it, I can update the patch to include this. |
@b4n, your |
They might help parsers (including uctags) not get confused by those macros. To still not have extra semicolons ISO C doesn't like, add a dummy typedef at the end, that has no purpose but allow (actually, require) a semicolon after. The macro uses a custom suffix to have an actually unique name for each typedef not to risk triggering a redundant declaration warning. I am however not sure why I don't see the warning without the specific suffix in dsl/* while I do see it in parsers/asm.c.
@masatake done. For now I added a new commit, but it can be merged. I'm however a bit puzzled, in parsers/asm.c I see the warning from |
@b4n Thank you. You developed an interesting technique. I would like to merge this pull request as is because the commit log for the commit introducing the technique is written well. People in another project can refer to the commit and this pull request. |
This fixes various mostly harmless warnings from GCC. This is not everything yet, and most of it is trivial, but it still gets rid of some and helps tidy code a little.