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

ns_list: avoid UINT_FAST8_MAX (fix ARM C 5 builds) #10809

Merged
merged 1 commit into from Jun 12, 2019

Conversation

Projects
None yet
5 participants
@kjbracey-arm
Copy link
Contributor

commented Jun 11, 2019

Description

Prevent compilation issues when someone has included <stdint.h> before a header file that needs to include <ns_list.h>.

Some toolchains like ARM C 5 will not provide UINT_FAST8_MAX in C++ unless __STDC_LIMIT_MACROS is defined, and if this was not defined the first time <stdint.h> was included, it's too late.

We can get the maximum value for our unsigned list offset by casting -1 to it, thanks to modulo arithmetic.

Pull request type

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

Reviewers

@artokin, @TeroJaasko

ns_list: avoid UINT_FAST8_MAX
Prevent compilation issues when someone has included <stdint.h> before
a header file that needs to include <ns_list.h>.

Some toolchains like ARM C 5 will not provide UINT_FAST8_MAX in C++
unless __STDC_LIMIT_MACROS is defined, and if this was not defined the
first time <stdint.h> was included, it's too late.

We can get the maximum value for our unsigned list offset by casting -1
to it, thanks to modulo arithmetic.
@TeroJaasko

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

This fixes the remaining ARMC5 issue. Thank you very much for quick response.

@adbridge

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

Ci started

@adbridge

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@TeroJaasko I tagged you for review , I know you commented already but could you approve the review please ?

@mbed-ci

This comment has been minimized.

Copy link

commented Jun 12, 2019

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
@mbed-ci

This comment has been minimized.

Copy link

commented Jun 12, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@adbridge adbridge merged commit cda2031 into ARMmbed:master Jun 12, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(-44279 bytes) RAM(+7555 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8495 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details

@kjbracey-arm kjbracey-arm deleted the kjbracey-arm:ns_list_stdint branch Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.