作者ric2k1 (Ric)
看板EE_DSnP
標題[建議] 關於 compile 時的 warning message
時間Mon Oct 15 15:02:41 2007
建議大家將 compiler warning message 的 option 打開 !!
(難怪他對於 unused variable 沒有 warning..)
For devC++:
Tools --> Compiler Options
在 "Add the following commands when calling compiler" 以及
"Add these commands to the linker command line"
加入:
-Wall
他將會 turn on 所有 warning message.
[Note] Make sure when you move to another file or call the devC++ again,
the options are still there...
For Linux:
When calling g++, please specify the "-Wall -g" options.
==> g++ -Wall -g ....
Note: -g is to turn on the debugging information.
Note: You can add
alias myg++ "g++ -Wall -g" to your .bashrc (your shell script)
so that you don't need to specify the options everytime.
You can just do "myg++ ...".
I don't know about Visual C++. 知道的人請補充...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.21.241
1F:推 jimjjj:visual C++ 的warning 和 error message是自動一起的 10/15 22:48
2F:推 ric2k1:自動一起? int main() { int a; } 會不會有 warning? 10/15 23:02
3F:推 jimjjj:和error message混在一起顯示(都在同一個框)..會的 10/16 22:39
4F:推 ilway25:老師的意思是他不知道 VC++ 怎麼讓warning 顯示「多一點」 10/16 22:49
5F:推 ric2k1:是的, 我就是樓上說的那個意思... 10/16 23:02