void 被compiler 看成 oid

2019-07-20 21:15发布

想要寫一個 max6675 的程序
但是
compiler 似乎把 void max6675_Init() 看成 oid max6675_Init()

所以,寫了兩個空函式測試
void max6657_Init(){}

int max6675_Init(){}

如果宣告成 void 會出現錯誤如下
------------------------------------
*** Using Compiler 'V5.05 update 2 (build 169)', folder: 'C:Keil_v515ARMARMCCBin'
Build target 'SPI'
compiling max6675.c...
..HARDWAREmax6675.c(4): error:  #260-D: explicit type is missing ("int" assumed)
  
oid max6675_Init(){}
..HARDWAREmax6675.c(4): error:  #260-D: explicit type is missing ("int" assumed)
  
oid max6675_Init(){}
..HARDWAREmax6675.c(38): warning:  #1-D: last line of file ends without a newline
  //
..HARDWAREmax6675.c: 1 warning, 2 errors
"..OBJSPI.axf" - 2 Error(s), 1 Warning(s).
-------------------------------------------------------------------------------

void 錯誤 void 錯誤
貌似 compiler 把 void 視為 oid


如果宣告成 int 則不會有錯誤
但會出現 缺少 return 的 warning
int int

請前輩指導一下,這到底是怎樣的錯誤
要如何修正?!
感謝您的回應

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。