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

Fix compilation warnings #13894

Merged
merged 2 commits into from Nov 12, 2020
Merged

Conversation

noonfom
Copy link

@noonfom noonfom commented Nov 10, 2020

Summary of changes

Recently, a user found that compiling Mbed OS with the GCC_ARM toolchain produces several warnings that could affect program reliability (#13604). It is not possible to fix all the warnings since there are a lot of 3rd party components in the tree. However, simple solutions exist for a some of the warnings. A few are given in Mbed-TLS/mbedtls#3867; others are supplied here.

compout.txt gives the compiler output after making the changes.

mbed compile -c -m NUCLEO_F446RE -t GCC_ARM &> ../compout.txt

compout.txt

warning.txt gives the remaining warnings.

cat compout.txt | grep "Warning" > warning.txt

warning.txt

Impact of changes

Migration actions required

Documentation

None


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

@pan-
@paul-szczepanek-arm


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Nov 10, 2020
@ciarmcom
Copy link
Member

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

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 10, 2020

@noonfom Please look at travis failures, look related

@@ -102,10 +102,13 @@ typedef struct secure_session {
} secure_session_t;

static NS_LIST_DEFINE(secure_session_list, secure_session_t, link);

#if COAP_SECURITY_AVAILABLE

Choose a reason for hiding this comment

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

Suggested change
#if COAP_SECURITY_AVAILABLE
#ifdef COAP_SECURITY_AVAILABLE

and others

@@ -885,7 +885,8 @@ void connection_handler_close_secure_connection(coap_conn_handler_t *handler, ui
if (handler->socket && handler->socket->is_secure) {
secure_session_t *session = secure_session_find(handler->socket, destination_addr_ptr, port);
if (session) {
#if COAP_SECURITY_AVAILABLE
#ifdef COAP_SECURITY_AVAILABLE
#ifdef COAP_SECURITY_AVAILABLE

Choose a reason for hiding this comment

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

oops

pan-
pan- previously approved these changes Nov 10, 2020
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

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

Thanks @noonfom this looks good. Can you rebase interactively your commits to cleanup the history ?
@ARMmbed/6lowpan-squad @artokin This PR contains minor changes to the nanostack, should we keep them ? If so how do we ensure that they are not lost in the next update

@artokin
Copy link
Contributor

artokin commented Nov 10, 2020

Thanks for the changes.

Is the coap-service compiled also with COAP_SECURITY_AVAILABLE disabled?

When we are making the next update, we will first merge these changes back to the original master repository. Then changes will not be lost.

@mergify mergify bot added needs: CI and removed needs: review labels Nov 11, 2020
@mergify mergify bot dismissed pan-’s stale review November 11, 2020 14:27

Pull request has been modified.

@paul-szczepanek-arm
Copy link
Member

Is the coap-service compiled also with COAP_SECURITY_AVAILABLE disabled?

Seems that way, otherwise CI wouldn't have failed when the #ifdef was mistakenly an #if and the define was missing.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

👍 for reducing the warnings

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 11, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 11, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit d5b4f42 into ARMmbed:master Nov 12, 2020
@mergify mergify bot removed the ready for merge label Nov 12, 2020
@mbedmain mbedmain added release-version: 6.5.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch labels Nov 18, 2020
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.

None yet

8 participants