Skip to content

Conversation

kjbracey
Copy link
Contributor

Description

User uses of MBED_MAKE_ERROR assemble a new error that gets its bottom 16 bits from an existing negative 32-bit error code. This led to undefined behaviour when << was used on it - even though it was a shift by zero!

Avoid the undefined behaviour warning from Clang by masking before shifting.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@deepakvenugopal, @SenRamakri

User uses of `MBED_MAKE_ERROR` assemble a new error that gets its bottom
16 bits from an existing negative 32-bit error code. This lead to
undefined behaviour when `<<` was used on it - even though it was a
shift by zero!

Avoid the undefined behaviour warning from Clang by masking before
shifting.
@ciarmcom ciarmcom requested review from deepakvenugopal, SenRamakri and a team April 12, 2019 15:00
@ciarmcom
Copy link
Member

@kjbracey-arm, thank you for your changes.
@SenRamakri @deepakvenugopal @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2019

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2019

The CI aborted, will be part of 10394 run

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Apr 15, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_dynamic-memory-usage

@alekla01
Copy link
Contributor

restarted jenkins-ci/mbed-os-ci_dynamic-memory-usage

@0xc0170 0xc0170 merged commit 237bf04 into ARMmbed:master Apr 16, 2019
@kjbracey kjbracey deleted the mbed_error_warnings branch April 17, 2019 08:43
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