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

NRF5x: Fix error_t conflict with gcc std>=gnu++11 #6115

Merged
merged 1 commit into from Feb 19, 2018

Conversation

andrewleech
Copy link
Contributor

Description

The Nordic implementation of FEATURE_BLE includes a typedef error_h which conflicts with a gcc standard implementation of error_h when compiled by GCC with newer standards enabled -std=gnu++11 or above.

The conflict is traced to nRF5XPalGattClient.cpp importing <memory.h>
This file does not actually need anything from this include however, it only requires <new.h> (for some compilers).

See #5979 for original fix and detailed discussion

Status

READY

Migrations

There should be no changes to end user code.

Related PRs

#5979

…t` whien compiling with gcc "-std=gnu++11" or above
@mbed-ci
Copy link

mbed-ci commented Feb 16, 2018

--none--

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 16, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 16, 2018

Build : SUCCESS

Build number : 1154
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6115/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Feb 16, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 16, 2018

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 for the fix; LGTM.

@0xc0170 0xc0170 merged commit 3fec23e into ARMmbed:master Feb 19, 2018
@andrewleech andrewleech deleted the nRF5XPalGattClient_include_new branch February 21, 2018 00:39
@brooksprumo
Copy link

Hi all, sorry in advance if this is the wrong place to post; let me know if/where this should be moved to instead.

I'm running into this same issue in Mbed 5.15.1, if I update the build profile to use C++17. With the default, C++14, everything compiles correctly.

I'm using an NRF52840 devkit and the Nordic BLE Softdevice too. Here's a snippet of the error. Let me know if there's more info anyone would like.

/home/me/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/errno.h:5:13: error: conflicting declaration 'typedef int error_t'
    5 | typedef int error_t;
      |             ^~~~~~~
In file included from ./mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/common/common.h:68,
                 from ./mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/btle/btle.cpp:17:
./mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/common/ble_error.h:143:2: note: previous declaration as 'typedef enum error_t error_t'
  143 | }error_t;
      |  ^~~~~~~
In file included from ./mbed-os/features/FEATURE_BLE/ble/GattClient.h:22,
                 from ./mbed-os/features/FEATURE_BLE/ble/BLE.h:25,
                 from ./mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xn.h:20,
                 from ./mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/btle/btle.cpp:28:

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

6 participants