Trying to fix this issue: C++ How can I prevent my team developers from using integer version of abs by mistake? by using macro to make abs
function not usable anymore.
If I compile a code containing myabs(3);
with g++ option -Dmyabs=abs
it compiles (myabs
being replaced by abs
), fine.
Now, if I compile a code containing abs(3);
with g++ option -Dabs=forbidden
it compiles too...why it does not report that forbidden
is unknown? Looks like abs
is not replaced by forbidden
during pre-processing...why?