-
Notifications
You must be signed in to change notification settings - Fork 3k
Macro expansion results in a constant boolean expression #6613
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 results in a constant boolean expression #6613
Conversation
460a760 to
090647e
Compare
|
I think the correct and optimised fix is to use |
|
Yes, replacing with |
kjbracey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, but please squash to one commit and get rid of all the unconnected formatting changes. We've got a big merge coming in from feature-emac, and I want to minimise conflicting changes to these areas.
9b15996 to
8e76150
Compare
|
Cool. Done. |
|
/morph build |
Build : SUCCESSBuild number : 1748 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1383 |
Test : SUCCESSBuild number : 1551 |
|
/morph mbed2-build |
Description
Because the function ip_addr_isany() is actually a macro, it ends up being expanded in place with a constant boolean result.
My solution is a dirty trick, providing a pointer variable alias. My thought that is the ideal solution would use a function rather than a macro, but there's probably other considerations
Pull request type
[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change