Skip to content

pkg/nimble: Remove warning suppressions, add patches#10511

Merged
smlng merged 2 commits intoRIOT-OS:masterfrom
jcarrano:nimble-slowfix
Nov 30, 2018
Merged

pkg/nimble: Remove warning suppressions, add patches#10511
smlng merged 2 commits intoRIOT-OS:masterfrom
jcarrano:nimble-slowfix

Conversation

@jcarrano
Copy link
Copy Markdown
Contributor

Contribution description

This is a "slowfix" for the quickfix introduced in #10503 .

Pointer alignment

This is the most serious one.

Nimble contains a couple of casts that discard alignment information. This causes a warning with clang's -Wno-address-of-packed-member.

A previous PR (#10503) supressed that warning. This commit re-enables them and provides a patch to fix the offending code.

The fix has been submitted upstream, see apache/mynewt-nimble#252

The other warning.

The -Wno-sometimes-uninitialized suppression seems to no longer be necessary. Removing it as it may mask a real bug.

If the problem reappears, and if the comment is correct about it being only in an unused function, then instead of adding the CFLAG, it should be fixed locally via a patch.

Testing procedure

Compile with LLVM. You should see no warning. I tried Arch Linux and our Docker image:

in examples/nimble_gatt:

$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" TOOLCHAIN=llvm make all
$ make clean
$ TOOLCHAIN=llvm make all

Issues/PRs references

Partially reverts #10503.
Upstream PR: apache/mynewt-nimble#252

Nimble contains a couple of casts that discard alignment information.
This causes a warning with clang's -Wno-address-of-packed-member.

A previous PR (RIOT-OS#10503) supressed that warning. This commit re-enables
them and provides a patch to fix the offending code.

The fix has been submitted upstream, see
apache/mynewt-nimble#252
The -Wno-sometimes-uninitialized suppression seems to no longer be
necessary. Removing it as it may mask a real bug.

If the problem reappears, and if the comment is correct about it
being only in an unused function, then instead of adding the CFLAG,
it should be fixed locally via a patch.
@jcarrano jcarrano added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: BLE Area: Bluetooth Low Energy support labels Nov 29, 2018
@jcarrano jcarrano requested a review from smlng November 29, 2018 13:18
Copy link
Copy Markdown
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

Nice one! Patch looks good to me, also reverting the -Wno-...!

Copy link
Copy Markdown
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

ACK, also checked with an older compiler, all good!

@smlng smlng merged commit 297aa4e into RIOT-OS:master Nov 30, 2018
@jcarrano
Copy link
Copy Markdown
Contributor Author

Thanks @smlng !

@aabadie aabadie added this to the Release 2019.01 milestone Dec 2, 2018
@jcarrano
Copy link
Copy Markdown
Contributor Author

jcarrano commented Dec 4, 2018

apache/mynewt-nimble#252 has been merged upstream.

@haukepetersen, Is a version bump planned any time soon? I would not want to mess with this PKG myself.

@rymanluk
Copy link
Copy Markdown

rymanluk commented Dec 5, 2018

@haukepetersen , I'm also interested on when it is going to be upgraded as for the moment Travis is failing on RIOT build on Mynewt-nimble repo. BTW is there a way to build RIOT without any additional patches on Nimble? That might solve a problem for the future.

@kaspar030
Copy link
Copy Markdown
Contributor

BTW is there a way to build RIOT without any additional patches on Nimble? That might solve a problem for the future.

Quickest way is to remove pkg/nimble/patches.

@rymanluk
Copy link
Copy Markdown

rymanluk commented Dec 5, 2018

yup, we just did it in our Travis.

@haukepetersen
Copy link
Copy Markdown
Contributor

Sorry, this PR went under my radar somehow. I am creating a nimble version dump and some makefile optimization as we speak. The general plan is to keep updating the nimble version every other month or so (or lets say roughly every RIOT release) for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: BLE Area: Bluetooth Low Energy support CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants