K
Karim Thapa
I defined a MACRO 'removebrace' as following
#define removebrace(x) x
main() {
...
MyFunc(1, 2, removebrace("hello", 5, 6));
....
}
I expect this statement to expand in
MyFunc(1, 2, "hello", 5, 6);
I use MSVC. I can see in disassembly that only three values are pushed
into the stack before calling function 'MyFunc', that is pointer to
string "hello", 2 and 1, instead of all five arguments.
However, if I do not use MACRO 'removebrace', all five values are
pushed into the stack and it works as expected.
I can't understand why using MACRO 'removebrace' creates problem.
Thanks for any help.
Karim
#define removebrace(x) x
main() {
...
MyFunc(1, 2, removebrace("hello", 5, 6));
....
}
I expect this statement to expand in
MyFunc(1, 2, "hello", 5, 6);
I use MSVC. I can see in disassembly that only three values are pushed
into the stack before calling function 'MyFunc', that is pointer to
string "hello", 2 and 1, instead of all five arguments.
However, if I do not use MACRO 'removebrace', all five values are
pushed into the stack and it works as expected.
I can't understand why using MACRO 'removebrace' creates problem.
Thanks for any help.
Karim