-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix C++11 build error w/ u-blox EVK-ODIN-W2 #4251
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When attempting to perform a test build of various mbed-os targets with GCC configured to build -std=gnu++11, all of the targets built successfully except for this one. It gave errors like this: ../mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/wifi_emac/wifi_emac_api.cpp: In function 'emac_interface_t* wifi_emac_get_interface()': ../mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/wifi_emac/wifi_emac_api.cpp:331:38: error: use of deleted function 'emac_interface::emac_interface()' _intf = new emac_interface_t(); ^ In file included from ../mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/wifi_emac/wifi_emac_api.cpp:9:0: ../mbed-os/hal/emac_api.h:150:16: note: 'emac_interface::emac_interface()' is implicitly deleted because the default definition would be ill-formed: typedef struct emac_interface { ^ ../mbed-os/hal/emac_api.h:150:16: error: uninitialized const member in 'struct emac_interface' ../mbed-os/hal/emac_api.h:151:32: note: 'const emac_interface_ops_t emac_interface::ops' should be initialized const emac_interface_ops_t ops; This commit contains a proposed change which fixes this issue by not using the new operator to allocate the emac_interface_t structure but instead using the malloc() function since the construction is being handled explicitly in the subsequent lines of the wifi_emac_get_interface() function anyway. I also added code which only completes the initialization of the _intf object if its allocation succeeds and just returns NULL otherwise. I see no deallocation of the _intf object occurring so no change from delete to free() needed to be made.
Thanks for the bugfix. It looks good to me. |
0xc0170
approved these changes
May 2, 2017
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
exmachina-auto-deployer
pushed a commit
to exmachina-dev/mbed-os
that referenced
this pull request
May 16, 2017
…lwip_broadcast Release mbed OS 5.4.5 and mbed lib v142 Ports for Upcoming Targets Fixes and Changes 4059: [Silicon Labs] Rename targets ARMmbed#4059 4115: Support for Qt Creator Generic project export and associated Makefile ARMmbed#4115 3915: Feature vscode ARMmbed#3915 4205: tests: race test - add not supported for single threaded env ARMmbed#4205 4187: [NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM ARMmbed#4187 4145: test - add nanostack to examples.json file ARMmbed#4145 4093: Update.py: New feature - update a branch instead of a fork, plus general improvements. ARMmbed#4093 4225: fixed missing device_name for xDot and removed progen ARMmbed#4225 4243: Config: config header file should contain new line ARMmbed#4243 4251: Fix C++11 build error w/ u-blox EVK-ODIN-W2 ARMmbed#4251 4236: STM32 Fixed warning related to __packed redefinition ARMmbed#4236 4224: Add `mbed new .` output to export ARMmbed#4224 4190: LPC4088: Enable LWIP feature ARMmbed#4190 4136: Error when bootloader is specified but does not exist ARMmbed#4136 3881: Remove debug links to printf/exit in NDEBUG builds ARMmbed#3881 4260: Inherit Xadow M0 target from LPC11U35_501 ARMmbed#4260 4249: Add consistent button names across targets ARMmbed#4249 4254: Removed unused variable in TARGET_NXP/lpc17_emac.c ARMmbed#4254
aisair
pushed a commit
to aisair/mbed
that referenced
this pull request
Apr 30, 2024
Ports for Upcoming Targets Fixes and Changes 4059: [Silicon Labs] Rename targets ARMmbed/mbed-os#4059 4187: [NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM ARMmbed/mbed-os#4187 4225: fixed missing device_name for xDot and removed progen ARMmbed/mbed-os#4225 4251: Fix C++11 build error w/ u-blox EVK-ODIN-W2 ARMmbed/mbed-os#4251 4236: STM32 Fixed warning related to __packed redefinition ARMmbed/mbed-os#4236 4190: LPC4088: Enable LWIP feature ARMmbed/mbed-os#4190 4260: Inherit Xadow M0 target from LPC11U35_501 ARMmbed/mbed-os#4260 4249: Add consistent button names across targets ARMmbed/mbed-os#4249
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attempting to perform a test build of various mbed-os targets with
GCC configured to build -std=gnu++11, all of the targets built
successfully except for this one. It gave errors like this:
This commit contains a proposed change which fixes this issue by not
using the new operator to allocate the emac_interface_t structure but
instead using the malloc() function since the construction is being
handled explicitly in the subsequent lines of the
wifi_emac_get_interface() function anyway.
I also added code which only completes the initialization of the _intf
object if its allocation succeeds and just returns NULL otherwise.
I see no deallocation of the _intf object occurring so no change from
delete to free() needed to be made.