// #TEST#: R25 Rename this macro argument
// #TEST#: R26 Rename this macro
#define MACRO_ONE_ARG(x_) (2.0f*x_)
3 L A T E S T R E P L I E S (Newest First)
feline
Posted - Jul 09 2014 : 3:47:38 PM This makes sense, I am wary of trying to be to clever with macros, given how complex some of them get, but you make a very good point. I have put in a feature request for this to see what our developers make of it:
case=83603
legalize
Posted - Jul 08 2014 : 11:34:28 AM We're talking about renaming the argument in a macro with arguments. Whether or not the macro has matching brackets, braces, etc., is irrelevant. The use of the macro argument is entirely within the macro definition and nowhere else.
feline
Posted - Jul 03 2014 : 11:56:24 PM Yes, but the problem is that a macro, in isolation, does not have to be valid code. There is no requirement that a macro will contain matching brackets, and I often see macros that do not contain matching brackets, where you need to pair a start and end macro to get the brackets to match.
Because of this, VA does not try to do to much with macros in isolation.
I agree that your macro is balanced, and its tempting to argue it should be a function, not a macro, where we can hope for matching brackets.