You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Macros will, logically, error out when they are passed too few arguments. But, by nature, extraneous arguments are simply ignored. This can be intentional, but I expect that this would be rare; so, I'm suggesting -Wunused-macro-arg enabled by -Wall.
In theory, we could also add some syntax for macros to specify how many arguments they want to be given; but I expect that adoption would be low, and thus I'm not sure it would be worth the implementation effort.
The text was updated successfully, but these errors were encountered:
There are definitely some macros which just take a "flag" argument whose actual value doesn't matter (often it's 1, could be TRUE if the codebase uses such a constant, but 0 or foobar or whatever would also work) and just influences behavior of a _NARG check. So if we have a warning like this, there should be a convenient way to disable the warning, i.e. one that could be done in the definition of the macro, not at every usage site.
Syntax "to specify how many arguments they want to be given" sounds like it would develop into #912.
Macros will, logically, error out when they are passed too few arguments. But, by nature, extraneous arguments are simply ignored. This can be intentional, but I expect that this would be rare; so, I'm suggesting
-Wunused-macro-arg
enabled by-Wall
.In theory, we could also add some syntax for macros to specify how many arguments they want to be given; but I expect that adoption would be low, and thus I'm not sure it would be worth the implementation effort.
The text was updated successfully, but these errors were encountered: