看板 EE_DSnP 關於我們 聯絡資訊
建議大家將 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
jimjjj:visual C++ 的warning 和 error message是自動一起的 10/15 22:48
ric2k1:自動一起? int main() { int a; } 會不會有 warning? 10/15 23:02
jimjjj:和error message混在一起顯示(都在同一個框)..會的 10/16 22:39
ilway25:老師的意思是他不知道 VC++ 怎麼讓warning 顯示「多一點」 10/16 22:49
ric2k1:是的, 我就是樓上說的那個意思... 10/16 23:02