Skip to content

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

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 12, 2019

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey 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

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.
@kjbracey kjbracey mentioned this pull request Jun 11, 2019
@TeroJaasko
Copy link
Contributor

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

@adbridge
Copy link
Contributor

Ci started

@adbridge
Copy link
Contributor

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

@mbed-ci
Copy link

mbed-ci 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
Copy link

mbed-ci 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
@kjbracey kjbracey deleted the ns_list_stdint branch June 28, 2019 11:25
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.

5 participants