Hi all, I found a macro "USE_VAR" in the code of bash-3.2 as
follows:
/*file: bash-3.2/shell.c*/
344 USE_VAR(argc);
345 USE_VAR(argv);
346 USE_VAR(env);
347 USE_VAR(code);
348 USE_VAR(old_err exit_flag);
349 #if defined (RESTRICTED_SHE LL)
350 USE_VAR(saverst );
I found the definition of this macro at file shell.h as follows:
116 /* Force gcc to not clobber X on a longjmp(). Old versions of gcc
mangle
117 this badly. */
118 #if (__GNUC__ 2) || (__GNUC__ == 2 && __GNUC_MINOR__ 8)
119 # define USE_VAR(x) ((void) &(x))
120 #else
121 # define USE_VAR(x)
122 #endif
I think these code doesn't do anything really , it just control the
process of compilation. But how does it works? If the "else"
condition in file shell.h is true, the lines 344~350 in shell.c would
turn into "; ; ; ; ;".But what would happen in another condition?
Thanx!
follows:
/*file: bash-3.2/shell.c*/
344 USE_VAR(argc);
345 USE_VAR(argv);
346 USE_VAR(env);
347 USE_VAR(code);
348 USE_VAR(old_err exit_flag);
349 #if defined (RESTRICTED_SHE LL)
350 USE_VAR(saverst );
I found the definition of this macro at file shell.h as follows:
116 /* Force gcc to not clobber X on a longjmp(). Old versions of gcc
mangle
117 this badly. */
118 #if (__GNUC__ 2) || (__GNUC__ == 2 && __GNUC_MINOR__ 8)
119 # define USE_VAR(x) ((void) &(x))
120 #else
121 # define USE_VAR(x)
122 #endif
I think these code doesn't do anything really , it just control the
process of compilation. But how does it works? If the "else"
condition in file shell.h is true, the lines 344~350 in shell.c would
turn into "; ; ; ; ;".But what would happen in another condition?
Thanx!
Comment