-
Notifications
You must be signed in to change notification settings - Fork 3k
Macro expansion leads to a bare expression #6614
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
Macro expansion leads to a bare expression #6614
Conversation
@pauluap Thanks for the contributions, I'll review them today. Please use PR type, use X to select what PR type is it to clarify the intent in your commits Second, use master as destination branch, not mbed-os-5.8 (we apply patches when release is prepared). |
… number) Compile: lwip_stack.c In file included from ../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:41:0: ../features/FEATURE_LWIP/lwip-interface/lwip_stack.c: In function 'mbed_lwip_bringup_2': ../features/FEATURE_LWIP/lwip-interface/ppp_lwip.h:58:44: warning: statement with no effect [-Wunused-value] #define ppp_lwip_disconnect() ERR_IF ^ ../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:858:21: note: in expansion of macro 'ppp_lwip_disconnect' ppp_lwip_disconnect(); ^~~~~~~~~~~~~~~~~~~ ../features/FEATURE_LWIP/lwip-interface/ppp_lwip.h:58:44: warning: statement with no effect [-Wunused-value] #define ppp_lwip_disconnect() ERR_IF ^ ../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:875:21: note: in expansion of macro 'ppp_lwip_disconnect' ppp_lwip_disconnect(); ^~~~~~~~~~~~~~~~~~~
c3d5063
to
449541c
Compare
I'll definitely use master as the merge target in the future. I did mark the PR as a fix. Does it need to be at the top of the PR or something? |
Equivalent changes are already on the feature-emac branch. No objection to having this on master now though - will get overwritten in merge. |
/morph build |
Build : SUCCESSBuild number : 1737 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1371 |
Test : SUCCESSBuild number : 1540 |
/morph mbed2-build |
Travis run, but did not report status back. I restarted it https://travis-ci.org/ARMmbed/mbed-os/builds/365358118 but might not still report it back :( We can try close/open |
sigh Going to close and reopen this to see if we can't get travis-ci to report it's success. |
Interesting. @0xc0170 @pauluap It looks like restarting the ci build wasn't working because the destination branch inside of travis somehow didn't get the message that this PR was change from |
Build : SUCCESSBuild number : 1777 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 1418 |
1 similar comment
Exporter Build : FAILUREBuild number : 1418 |
Test : SUCCESSBuild number : 1587 |
Pipe closed, restarting exporters /morph export-build |
Exporter Build : SUCCESSBuild number : 1427 |
Description
If the implementation used functions, a function returning a bare value wouldn't be a problem, but here the 'return' is done by macro expansion. Since the value isn't assigned to anything, it turns out to be a bare expression, thus the warning message.
Cast to void to ignore, technique distilled from https://stackoverflow.com/questions/777261/avoiding-unused-variables-warnings-when-using-assert-in-a-release-build
Pull request type
[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change