作者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