基於Turbo C(V2.0)編譯錯誤資訊的詳細介紹

來源:互聯網
上載者:User

說明:Turbo C 的來源程式錯誤分為三種類型:致命錯誤、一般錯誤和警告。其中,致命錯誤通常是內部編譯出錯;一般錯誤指程式的語法錯誤、磁碟或記憶體存取錯誤或命令列錯誤等;警告則只是指出一些得懷疑的情況,它並不防止編譯的進行。

  下面按字母順序A~Z分別列出致命錯誤及一般錯誤資訊,英漢對照及處理方法:

(一)、致命錯誤英漢對照及處理方法:

A-B致命錯誤

Bad call of in-line function (內建函式非法調用)
分析與處理:在使用一個宏定義的內建函式時,沒能正確調用。一個內建函式以兩個底線(__)開始和結束。

Irreducable expression tree (不可約運算式樹狀架構)
分析與處理:這種錯誤指的是檔案行中的運算式太複雜,使得代碼產生程式無法為它產生代碼。這種運算式必須避免使用。

Register allocation failure (儲存空間分配失敗)
分析與處理:這種錯誤指的是檔案行中的運算式太複雜,代碼產生程式無法為它產生代碼。此時應簡化這種繁雜的運算式或乾脆避免使用它。

(二)、一般錯誤資訊英漢照及處理方法

#operator not followed by maco argument name(#運算子後沒跟宏變元名)
分析與處理:在宏定義中,#用於標識一宏變串。“#”號後必須跟一個宏變元名。

'xxxxxx' not anargument ('xxxxxx'不是函數參數)
分析與處理:在來源程式中將該標識符定義為一個函數參數,但此標識符沒有在函數中出現。

Ambiguous symbol 'xxxxxx' (二義性符號'xxxxxx')
分析與處理:兩個或多個結構的某一網域名稱相同,但具有的位移、類型不同。在變數或運算式中引用該域而未帶結構名時,會產生二義性,此時需修改某個網域名稱或在引用時加上結構名。

Argument # missing name (參數#名丟失)
分析與處理:參數名已脫離用於定義函數的函數原型。如果函數以原型定義,該函數必須包含所有的參數名。 Argument list syntax error (參數表出現語法錯誤)
分析與處理:函數調用的參數間必須以逗號隔開,並以一個右括弧結束。若源檔案中含有一個其後不是逗號也不是右括弧的參數,則出錯。

Array bounds missing (數組的界限符"]"丟失)
分析與處理:在源檔案中定義了一個數組,但此數組沒有以下右方括弧結束。

Array size too large (數組太大)
分析與處理:定義的數組太大,超過了可用記憶體空間。

Assembler statement too long (彙編語句太長)
分析與處理:內部彙編語句最長不能超過480位元組。

Bad configuration file (設定檔不正確)
分析與處理:TURBOC.CFG設定檔中包含的不是合適命令列選擇項的非註解文字。設定檔命令選擇項必須以一個虛線開始。

Bad file name format in include directive(包含指令中檔案名稱格式不正確)
分析與處理:包含檔案名稱必須用引號("filename.h")或角括弧(<filename>)括起來,否則將產生本類錯誤。如果使用了宏,則產生的擴充文本也不正確,因為無引號沒辦法識別。

Bad ifdef directive syntax (ifdef指令語法錯誤)
分析與處理:#ifdef必須以單個標識符(只此一個)作為該指令的體。

Bad ifndef directive syntax (ifndef指令語法錯誤)
分析與處理:#ifndef 必須以單個標識符(只此一個)作為該指令的體。

Bad undef directive syntax (undef指令語法錯誤)
分析與處理:#undef指令必須以單個標識符(只此一個)作為該指令的體。

Bad file size syntax (位欄位長語法錯誤)
分析與處理:一個位欄位長必須是1—16位的常量運算式。

Call of non-functin (調用未定義函數)
分析與處理:正被調用的函數無定義,通常是由於不正確的函式宣告或函數名拼錯而造成。

Cannot modify a const object (不能修改一個長量對象)
分析與處理:對定義為常量的對象進行不合法操作(如常量賦值)引起本錯誤。

Case outside of switch (Case 出現在switch外)
分析與處理:編譯器發現Case語句出現在switch語句之外,這類故障通常是由於括弧不匹配造成的。

Case statement missing (Case語句漏掉)
分析與處理:Case語必須包含一個以冒號結束的常量運算式,如果漏了冒號或在冒號前多了其它符號,則會出現此類錯誤。

Character constant too long (字元常量太長)
分析與處理:字元常量的長度通常只能是一個或兩個字元長,超過此長度則會出現這種錯誤。

Compound statement missing (漏掉複合陳述式)
分析與處理:編譯器掃描到源檔案未時,未發現結束符號 (大括弧),此類故障通常是由於大括弧不匹配所致。

Conflicting type modifiers (類型修飾符衝突)
分析與處理:對同一指標,只能指定一種變址修飾符(如near 或far);而對於同一函數,也只能給出一種語言修飾符(如Cdecl、pascal或interrupt)。

Constant expression required (需要常量運算式)
分析與處理:數組的大小必須是常量,本錯誤通常是由於#define常量的拼字錯誤引起。

Could not find file 'xxxxxx.xxx' (找不到'xxxxxx.xx'檔案)
分析與處理:編譯器找不到命令列上給出的檔案。

Declaration missing (漏掉了說明)
分析與處理:當源檔案中包含了一個struct或 union域聲明,而後面漏掉了分號,則會出現此類錯誤。

Declaration needs type or storage class(說明必須給出類型或儲存類)
分析與處理:正確的變數說明必須指出變數類型,否則會出現此類錯誤。

Declaration syntax error (說明出現語法錯誤)
分析與處理:在源檔案中,若某個說明丟失了某些符號或輸入多餘的符號,則會出現此類錯誤。

Default outside of switch (Default語句在switch語句外出現)
分析與處理:這類錯誤通常是由於括弧不匹配引起的。

Define directive needs an identifier (Define指令必須有一個標識符)
分析與處理:#define 後面的第一個非空格符必須是一個標識符,若該位置出現其它字元,則會引起此類錯誤。

Division by zero (除數為零)
分析與處理:當源檔案的常量運算式出現除數為零的情況,則會造成此類錯誤。

Do statement must have while (do語句中必須有While關鍵字)
分析與處理:若源檔案中包含了一個無While關鍵字的 do語句,則出現本錯誤。

DO while statement missing ( (Do while語句中漏掉了符號 "(")
分析與處理:在do語句中,若 while關鍵字後無左括弧,則出現本錯誤。 Do while statement missing;(Do while語句中掉了分號)
分析與處理:在DO語句的條件運算式中,若右括弧後面無分號則出現此類錯誤。

Duplicate Case (Case情況不唯一)
分析與處理:Switch語句的每個case必須有一個唯一的常量運算式值。否則導致此類錯誤發生。

Enum syntax error (Enum語法錯誤)
分析與處理:若enum說明的標識符表格式不對,將會引起此類錯誤發生。

Enumeration constant syntax error (枚舉常量語法錯誤)
分析與處理:若賦給enum類型變數的運算式值不為常量,則會導致此類錯誤發生。

Error Directive : xxxx (Error指令:xxxx)
分析與處理:源檔案處理#error指令時,顯示該指令指出的資訊。

Error Writing output file (寫輸出檔案錯誤)
分析與處理:這類錯誤通常是由於磁碟空間已滿,無法進行寫入操作而造成。

Expression syntax error (運算式語法錯誤)
分析與處理:本錯誤通常是由於出現兩個連續的操作符,括弧不匹配或缺少括弧、前一語句漏掉了分號引起的。

Extra parameter in call (調用時出現多餘參數)
分析與處理:本錯誤是由於調用函數時,其實際參數個數多於函數定義中的參數個數所致。

Extra parameter in call to xxxxxx(調用xxxxxxxx函數時出現了多餘參數)

File name too long (檔案名稱太長)
分析與處理:#include指令給出的檔案名稱太長,致使編譯器無法處理,則會出現此類錯誤。通常DOS下的檔案名稱長度不能超過 64個字元。

For statement missing ) (For語名缺少")")
分析與處理:在 for語句中,如果控製表達式後缺少右括弧,則會出現此類錯誤。

For statement missing( (For語句缺少"(")

For statement missing; (For 語句缺少";")
分析與處理:在 for語句中,當某個運算式後缺少分號,則會出現此類錯誤。

Function call missing) (函數調用缺少")")
分析與處理:如果函數調用的參數表漏掉了右手括弧或括弧不匹配,則會出現此類錯誤。

Function definition out ofplace (函數定義位置錯誤)

Function doesn't take a variable number of argument(函數不接受可變的參數個數)

Goto statement missing label (Goto語句缺少標號)

If statement missing( (If語句缺少"(")

If statement missing) (If語句缺少")")

lllegal initalization (非法初始化)

lllegal octal digit (非法八位元)
分析與處理:此類錯誤通常是由於八進位常數中包含了非八位元字所致。

lllegal pointer subtraction (非法指標相減)

lllegal structure operation (非法結構操作)

lllegal use of floating point (浮點運算非法)

lllegal use of pointer (指標使用非法)

Improper use of a typedef symbol (typedef符號使用不當)

Incompatible storage class (不相容的儲存類型)

Incompatible type conversion (不相容的類型轉換)

Incorrect commadn line argument:xxxxxx (不正確的命令列參數:xxxxxxx)

Incorrect commadn file argument:xxxxxx (不正確的設定檔參數:xxxxxxx)

Incorrect number format (不正確的資料格式)

Incorrect use of default (deflult不正確使用)

Initializer syntax error (初始化語法錯誤)

Invaild indrection (無效的間接運算)

Invalid macro argument separator (無效的宏參數分隔字元)

Invalid pointer addition (無效的指標相加)

Invalid use of dot (點使用錯)

Macro argument syntax error (宏參數語法錯誤)

Macro expansion too long (宏擴充太長)

Mismatch number of parameters in definition(定義中參數個數不匹配)

Misplaced break (break位置錯誤)

Misplaced continue (位置錯)

Misplaced decimal point (十進位小數點位置錯)

Misplaced else (else 位置錯)

Misplaced else driective (clse指令位置錯)

Misplaced endif directive (endif指令位置錯)

Must be addressable (必須是可編址的)

Must take address of memory location (必須是記憶體一地址)

No file name ending (無檔案終止符)

No file names given (未給出檔案名稱)

Non-protable pointer assignment (對不可移植的指標賦值)

Non-protable pointer comparison (不可移植的指標比較)

Non-protable return type conversion (不可移植的傳回型別轉換)

Not an allowed type (不允許的類型)

Out of memory (記憶體不夠)

Pointer required on left side of (操作符左邊須是一指標)

Redeclaration of 'xxxxxx' ('xxxxxx'重定義)

Size of structure or array not known (結構或數組大小不定)

Statement missing; (語句缺少“;”)

Structure or union syntax error (結構或聯合語法錯誤)

Structure size too large (結構太大)

Subscription missing ] (下標缺少‘]')

Switch statement missing ( (switch 語句缺少"(")

Switch statement missing ) (switch 語句缺少")")

Too few parameters in call (函數調用參數太少)

Too few parameter in call to'xxxxxx'(調用'xxxxxx'時參數太少)

Too many cases (Cases太多)

Too many decimal points (十進位小數點太多)

Too many default cases (defaut太多)

Too many exponents (階碼太多)

Too many initializers (初始化太多)

Too many storage classes in declaration (說明中儲存類太多)

Too many types in decleration (說明中類型太多)

Too much auto memory in function (函數中自動儲存太多)

Too much global define in file (檔案中定義的全域資料太多)

Two consecutive dots (兩個連續點)

Type mismatch in parameter # (參數"#"類型不符)

Type mismatch in parameter # in call to 'XXXXXXX' (調用'XXXXXXX'時參數#類型不符)

Type missmatch in parameter 'XXXXXXX' (參數'XXXXXXX'類型不符)

Type mismatch in parameter 'YYYYYYYY' in call to 'YYYYYYYY'(調用'YYYYYYY'時參數'XXXXXXXX'數型不匹配)

Type mismatch in redeclaration of 'XXX' (重定義類型不符)

Unable to creat output file 'XXXXXXXX.XXX' (不能建立輸出檔案'XXXXXXXX.XXX')

Unable to create turboc.lnk (不能建立turboc.lnk )

Unable to execute command 'xxxxxxxx'(不能執行'xxxxxxxx'命令)

Unable to open include file 'xxxxxxx.xxx' (不能開啟包含檔案'xxxxxxxx.xxx')

Unable to open inputfile 'xxxxxxx.xxx' (不能開啟輸入檔案'xxxxxxxx.xxx')

Undefined label 'xxxxxxx' (標號'xxxxxxx'未定義)

Undefined structure 'xxxxxxxxx' (結構'xxxxxxxxxx'未定義)

Undefined symbol 'xxxxxxx' (符號'xxxxxxxx'未定義)

Unexpected end of file in comment started on line #(源檔案在某個注釋中意外結束)

Unexpected end of file in conditional stated on line # (源檔案在#行開始的條件陳述式中意外結束)

Unknown preprocessor directive 'xxx' (不認識的預先處理指令:'xxx')Untermimated character constant (未終結的字元常量)

Unterminated string (未終結的串)

Unterminated string or character constant(未終結的串或字元常量)

User break (使用者中斷)

Value required (賦值請求)

While statement missing ( (While語句漏掉 '(')

While statement missing ) (While語句漏掉 ')')

Wrong number of arguments in of 'xxxxxxxx' (調用'xxxxxxxx'時參數個數錯誤)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.