-
Notifications
You must be signed in to change notification settings - Fork 0
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
Removed extra parameters from variadic functions' prototype in spuro.h #5
Conversation
I am confused. Why did you open a new PR, closed the old one, and never replied to my questions? From my pov, I'm still waiting on them replies. |
I knew it .. i was wondering why you didn't review it and you forgot to publish your review. Reason for discarding old PR is because i submitted one more commit which was breaking. |
That's fine, I just copied my comments over! :) Can you see them now? @khushal-banks |
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.
It would be best if we can update makefile.yml to windows and macos platform and more tests for different compilers.
I was thinking: this commit added a bunch of macro names to be called with no format (pass the plain cstring). Would those be useless after this merge, if the changes solve the zero-arg conundrum? |
I missed them. Yes to all of your questions. Can i add a commit to reflect those changes in this PR? |
I'm not sure what you mean. Could you explain what you mean before, or add these changes to a different branch (on top of this one) and link to it, so that the PR can stay as-is for now? |
I will see what i can do. |
I already tested on |
Could you help me on this one? I'm trying to understand what you meant. Do you mean something like still having a different name for functions forcing a format argument? |
Here is the git diff of new branch. I am not sure but I think you want some of these changes but i am not sure which ones. |
Thanks a lot, this is really close to what I was thinking. I'm gonna reply here if you don't mind, but don't close that one yet. The question I'm asking myself is: think of If it's the latter (it just relies on Still, I wonder if hiding this difference in the called macro would pose problems later. I guess as long as the underlying real signature has arguments before the variadic trail, we would be able to add new future parameters to the left part and old code could receive them by macro expansion with no problem. Does keeping the explicit format argument in the macro signature allow for some selective logic that would not be possible otherwise? Any kind of validation being lost? I don't know. Tested this PR and it seems to work as expected on The real final question is, what advantages does the explicit format argument in macro definition allow? |
Brother there is no trick.
They both are very similar. They both contain format argument. This clang issue is only with macros as explained below:
NOTE: syntax of spr_logf_ is not modified by PR.
I don't think keeping the "f" or removing it makes much difference. In my personal opinion, these macro would start making more sense if we remove "f" simply because
For now, i don't see any issue. But i would say i am no expert. I happen to know solution for #3 so i tried my best to fix it. In my understanding compiler will first replace all macros with their expansion at pre-processing stage so this PR should pose no problem. Actually, it is only valid solution to solve #3 unless clang starts supporting
I was wondering that there could be some unknown arch-specific implementation that could break this PR. If this works, please merge it. Because it won't be wrong. It should be acceptable to deal with unknown issues later. For your final question. I would start my answer by saying feel free to ask more questions. I believe you are forgetting that macros are only text replacement. We are removing format argument from macro definition so it could take place of |
I would request you to merge this PR.
If you don't think this PR can be merged. I would happily close this. |
* fix: include stdlib.h * fix: Removed extra parameters from variadic functions' prototype in spuro.h (#5) - Solve variadic macro warning for clang - Drop usage of ## in macro definitions Co-authored-by: Khushal <khushal.banks@gmail.com>
Removed extra arguments from functions' prototypes declared in header file to fix #3
Tip
Please add clang compiler test in workflow