-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
src: squelch unused function warnings in util.h #9083
src: squelch unused function warnings in util.h #9083
Comments
I think the compiler needs to know the function to actually inline it. So including the implementation in the header file should solve the problem. util-inl.h has the implementation, whereas util.h does not, hence the warnings. Simply copying the implementation to util.h will work |
I'll reference a pull request soon |
@bnoordhuis, do I need to make changes to util.h to add implementation or was it just a doubt you wanted to clarify? Because adding implementation would be equivalent to using util.h |
I was thinking more of adding a NODE_UNUSED macro that evaluates to |
@Tanuja-Sawant hey, are you going to make a macro? Seems this is a good first contribution I'd like to make, but if you're in progress I will not 'course. Anyway I'd like to see the fix when it's done. |
@soleboxy ahaha, seems you're ahead of me :) |
@bnoordhuis Hi, Ben. Can you explain for a newbie like me what do you mean by making a macro? Am I right in assuming it should be like this: #define NODE_UNUSED(expr) __attribute__((expr)) How is it assumed to be applied in this case and why just not to move inlines like @soleboxy did? |
Never mind what I said, I thought the warnings were for the non-templated versions but reading the warnings again, it complains about the non-templated versions using template instances. |
@bnoordhuis check out my changes, i responded to your comment. (and offered another solution, wonder what you think about it) |
No problem! I look forward to see the solution to this issue =) |
👍 :) |
no problem im on it 👍 |
@bnoordhuis - hey ben , sorry to bother but could you approve my PR please? |
Fixes: nodejs#9083 moved function bodies back src: squelch unused function warnings in util.h. Fixes: nodejs#9083 moved back to previouse commit lets hope this is the correct answer src: squelch unused function warnings in util.h. Fixes: nodejs#9083 src: squelch unused function warnings in util.h. Fixes: nodejs#9083 src: squelch unused function warnings in util.h. Fixes: nodejs#9083 src: squelch unused function warnings in util.h. Fixes: nodejs#9083 src: squelch unused function warnings in util.h. Fixes: nodejs#9083
Paper-cut issue. When you include util.h but not util-inl.h, you get the following warnings:
The text was updated successfully, but these errors were encountered: