歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> warning: ISO C90 forbids mixed declarations and code

warning: ISO C90 forbids mixed declarations and code

日期:2017/3/3 13:02:15   编辑:Linux技術

Linux內核編程中遇到的問題,意思是聲明和代碼不能寫在一起

不能寫成

[code]int i = 0;
int temp = 0;
int flag = 0;
或者

[code]int i;
i = 0;
int temp;
temp = 0;
int flag;
flag = 0;
必須寫成

[code]int i,temp,flag;
i=0;
temp=0;
flag=0;
另外,還有一種情況變量定義之前任何一條非變量定義的語句都會引起這個警告,

要將非變量的定義移到變量定義之後

Copyright © Linux教程網 All Rights Reserved