makefile - `Is defining a macro via -D option ALWAYS equivalent to #define MACRO (except precedence) -


i have third party piece of code works differently when add macro via makefile e.g. -dmacro instead of doing #define macro in top level header file (which documentation implies included in files).

i googled if there differences in defining in different ways not come except precedence of -d macro , #define macro.

i wondering if missing make documentation / c standards before start debugging , determining issue.

thanks answers.

usually, it's same neither make nor iso standard have it. it's compiler itself, may not have -d option.

to make, it's running command (such gcc) whatever options takes. iso doesn't specify anything how run compiler, how compiler (and things creates) behaves.

for gcc, preprocessor options can found here looks is identical #define.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -