我寫了代碼,一切就OK了,編譯和工作沒有問題,當我用GCC 4.7.2開關-Wall
我得到以下警告編譯:POSIXÇ`警告:變量「表」集而不used`
warning: variable ‘tables’ set but not used [-Wunused-but-set-variable]
我知道這不是問題,但它爲什麼會出現?看起來不合邏輯:
const unsigned char *tables;
char *loc = setlocale(LC_ALL, 0);
setlocale(LC_ALL, loc);
tables = pcre_maketables();
我的變量是SET並且被使用。任何想法?
我沒有看到,它被使用,除了分配。 –
你只分配東西它(你設置它)。但你不使用它的話,那麼爲什麼你懶得GCC奇蹟分配給它,如果你不打算用它做什麼。 – nos
分配變量'tables'爲NULL。 – t0mm13b