Compile time decision...
I have two function foo_good and foo_critically_good. Both the function does conceptually the same thing. Meaning, the code (some fixes in critically_good function) and parameters passed are the same. Only difference is foo_good resides in part of memory that cannot be changed but foo_critically_good can be changed.
We have set of such functions, e.g foo1_good, foo2_good, foo3_good etc. foox_critically_good may not exits at all the time. Whenever we find problem with foox_good, we code foox_critically_good and wherever the code calls foox_good needs to be replaced by foox_critically_good. This case need to handled with individual functions.
Whenever we need critically good, then set the macro to TRUE and build the image again. This solution is compile time solution and this is what we want.
Have a macro in header file
#define foox_critically_good TRUE or FALSE
#define foox foox_critically_good
#define foox foox_good
Is there any better method than this?
Not that I can think of in C. This is one of the primary purposes for the preprocessor.
The macro statement
just checks whether the macro is defined or not. So even if you defined it as FALSE, it will return true.