-
Notifications
You must be signed in to change notification settings - Fork 3k
NRF: fix implicit declarations #13044
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
NRF: fix implicit declarations #13044
Conversation
3cd09a2
to
849a22c
Compare
@hugueskamba, thank you for your changes. |
@@ -45,6 +45,7 @@ extern bool m_common_rtc_enabled; | |||
extern uint32_t volatile m_common_rtc_overflows; | |||
extern bool volatile lp_ticker_interrupt_fire; | |||
|
|||
void common_rtc_free(); |
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.
I'd expect this to be still warning you. You need (void)
in C.
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.
No warning after the change. Is it perhaps because a C++ compiler is used?
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.
It is legal in C, so a compiler may not warn, even in C mode.
But it's an old-style (pre-C90) "unspecified parameters" declaration. You don't mean that - you do specifically want to declare it as taking no parameters.
Calling common_rtc_free(3)
is valid with that declaration. Wouldn't be with (void)
.
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.
Just double-checked that they didn't make any changes in C11. Apparently not - still the same as C99:
The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature.
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.
Done.
As a result removes warnings
849a22c
to
992133b
Compare
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.
LGTM
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
This PR does not contain release version label after merging. |
Summary of changes
As a result removes warning.
Impact of changes
n/a
Migration actions required
n/a
Documentation
n/a
Pull request type
Test results
Reviewers
@paul-szczepanek-arm @mprse @MarceloSalazar