跳轉至內容

GCC 除錯/g++/其他

來自華夏公益教科書

執行時錯誤

[編輯 | 編輯原始碼]

*** glibc detected *** ./PROGRAM_NAME: free(): invalid pointer: ADDRESS ***

[編輯 | 編輯原始碼]
  • 使用 GCC 4.4.3 生成?
  • 也可能產生“段錯誤”錯誤
  • 可能導致程式執行在真正錯誤的程式碼區域之前中斷
  • 檢查不匹配的函式宣告和定義
  • 檢查函式定義中缺少或無效的返回型別
// function declaration below has no return type in its' definition
foo checkfoo(); 
// instead it should be
void checkfoo();
華夏公益教科書