I just spotted this in the legacy code. I know that using the macro, whenever the name is used, it is replaced by the contents of the macro. They are most commonly used to give symbolic names to numeric constants.What I know is preprocess has no notion of type safety, scope.
What is the real benefit of doing like this?
#define STATIC static
STATIC function1() { /*Do something*/ }
I knew that static functions are visible only in that module or translation unit. Not visible outside of the C file they are defined.
Why not just declare like this, instead of macro replacement?
static function1() { /*Do something*/ }
I thought I will find an answer in SO but I didn't find any proper answer.