Conversation
|
Hi baziotis! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
I just did that, I hope it's fine. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Looks like there are some CI issues on appveyor:) |
Thank you, I saw that but I'm not sure why that is. It's weird because it's the only one failing. Maybe the MSVC version does not support a C feature I used. I don't have a Windows machine at hand but I'll try to find one. |
|
Ok, I found some time to test on a Windows machine. Here's a somewhat small example that can recreate the bug: I probably have used some GCC specific feature but I can't see where. I'll try to check again tomorrow. Btw, is the |
|
I forgot to add yesterday: MSVC doesn't seem to have the equivalent of pedantic, so we can just ignore it, which is the better choice anyway. It has |
|
Ping :) |
|
This topic is a bit difficult. Do I understand correctly that the main issue is to silence some warnings about invoking some variadic macros with zero argument (mostly The PR does the job. And reaching 0-warning at It's a vague feeling, but the changes introduced seem intuitively too heavy for the problem at hand. And it becomes a question of maintenance : do we want to maintain that code ? Can we read and modify it easily ? Does it feel clear enough ? Do we fully understand its potential side effects ? I may be just me, but when I read the code, I don't have the feeling that I "fully get it". I can read the comment (they are clear, thanks), I can imply what it does, but it still feels, well, hacky. I can't anticipate what kind of side effects this hack may introduce. I'm not sure if there is a better solution. |
|
@Cyan4973 I agree with your comment very much. I probably have mentioned in some comment somewhere that I am not particularly proud of the solution, but it was the best I could (note that even finding a solution was difficult). And unfortunately, from what I know regarding the preprocessor, I don't think there's a simpler one. |
|
Yeah, I looked around too, but could not find any reasonable solution with mild complexity. Thanks for trying ! |
|
No problem. |
This is a hacky solution to the problem, I'm not particularly proud of it. It should however be sufficient.
We reduce the macro so that we can essentially "deduce" the correct final macro. The final macros are in all versions 2: Either the one that has exactly the number of actual arguments (i.e. non-variadic e.g. for
RETURN_ERROR_IF, they're 2,condanderr) or the one that has this number of actual arguments plus the variadic one.Browsing the makefiles was somewhat difficult,
-pedanticshould definitely be added in other places.