2017-02-16 61 views
0

我剛纔看到這個在bash的源:這是什麼解析?

/* Force gcc to not clobber X on a longjmp(). Old versions of gcc mangle 
    this badly. */ 
#if ....... 
# define USE_VAR(x) ((void) &(x)) 
..... 

我的問題是什麼呢((void) &(x))解析到?它在bash的main使用如下:

..... 
USE_VAR(argc); 
USE_VAR(argv); 
USE_VAR(env); 
...... 

回答

3

它採用的x地址,然後將其轉換爲void。結果是 - 什麼都沒有。

但是,編譯器可能會認爲,當一個變量的地址被採用時,它被「使用」了。

相關問題