Skip to content

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

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

hugueskamba
Copy link
Collaborator

@hugueskamba hugueskamba commented May 29, 2020

Summary of changes

As a result removes warning.

Impact of changes

n/a

Migration actions required

n/a

Documentation

n/a


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@paul-szczepanek-arm @mprse @MarceloSalazar


@hugueskamba hugueskamba force-pushed the hk_nrf_implicit_declaration branch from 3cd09a2 to 849a22c Compare May 29, 2020 19:47
@ciarmcom ciarmcom requested review from mprse, paul-szczepanek-arm and a team May 29, 2020 21:00
@ciarmcom
Copy link
Member

@hugueskamba, thank you for your changes.
@paul-szczepanek-arm @mprse @ARMmbed/mbed-os-pan @ARMmbed/mbed-os-maintainers please review.

@@ -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();
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

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).

Copy link
Contributor

@kjbracey kjbracey Jun 1, 2020

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.

Copy link
Collaborator Author

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
@hugueskamba hugueskamba force-pushed the hk_nrf_implicit_declaration branch from 849a22c to 992133b Compare June 1, 2020 09:27
Copy link
Contributor

@gpsimenos gpsimenos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Jun 2, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 5, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 5, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added the release-type: patch Indentifies a PR as containing just a patch label Jun 5, 2020
@0xc0170 0xc0170 merged commit 49c1d94 into ARMmbed:master Jun 5, 2020
@mergify mergify bot removed the ready for merge label Jun 5, 2020
@mergify
Copy link

mergify bot commented Jun 5, 2020

This PR does not contain release version label after merging.

@mergify mergify bot added the release version missing When PR does not contain release version, bot should label it and we fix it afterwards label Jun 5, 2020
@hugueskamba hugueskamba deleted the hk_nrf_implicit_declaration branch June 5, 2020 23:54
@adbridge adbridge added release-version: 6.1.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jun 24, 2020
@0xc0170 0xc0170 removed the release version missing When PR does not contain release version, bot should label it and we fix it afterwards label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants