If one macro is defined for "assignment": Ex. #define equal(a,b) {a=b; }
And write: equal(A,1); equal(A,2); equal(A,3);
where A is pointer to XDATA space(mapped to H/W)
Keil C will "optimize" them and final result is A=3 ? or Keil C won't do this and expand them one by one ?
Thanks in advance...
Thanks for your opinion...Initially I thought these 2 were different and thus posted 2 threads.
Please help to remove one of them if available...
Thanks anyway !
Thanks for your opinion
It is not an "opinion" =:0
They did not respond with opinions, but with facts.
Another thing - a #define named equal(a,b) should really represent a comparison - (is a equal to b?).
If you want your define to assign values, you should call it assign(a,b). Now, this was an opinion - never use confusing names for variables, defines, functions, ...
But as already mentioned, the preprocessor is really a preprocessor (even if implemented inside the compiler) doing text-based search/replace in your source code before the compiler starts to decide what the code looks like and starts with optimizations/code generation.
Thanks for all the facts you provided ^o^