S
Shriramana Sharma
Hello. I found that the C standard prescribes that once a translation unit has undergone macro replacement once, it will be rescanned for further macros to be replacement and again and again until there are no more macros to replace.
Due to this rescanning, I can write:
# define MyInt int
# define int short
MyInt a ;
or:
# define int short
# define MyInt int
MyInt a ;
and in both cases the final output of the preprocessor is:
short a ;
My question is: in which of the above inputs i.e. later definition modifies output of earlier definition or vice versa would the preprocessor arrive at "no more macros to replace" status quicker?
Due to this rescanning, I can write:
# define MyInt int
# define int short
MyInt a ;
or:
# define int short
# define MyInt int
MyInt a ;
and in both cases the final output of the preprocessor is:
short a ;
My question is: in which of the above inputs i.e. later definition modifies output of earlier definition or vice versa would the preprocessor arrive at "no more macros to replace" status quicker?