Keil 報錯 declaration may not appear after executable statement in block的解決辦法
在移植修改例程代碼時,Keil 報錯 “declaration may not appear after executable statement in block”,如下圖所示:
經(jīng)檢查代碼并沒有問題,復(fù)制粘貼過來也行不通,說明不是代碼本事的問題,應(yīng)該時編譯器的設(shè)置的問題。
C99 標(biāo)準(zhǔn)
C語言本身是有ANSI的標(biāo)準(zhǔn)的,但是隨著C++的發(fā)展,C語言的標(biāo)準(zhǔn)也不斷的修正和改進(jìn),1999年ISO發(fā)表了新的標(biāo)準(zhǔn),常被稱作C99。C99加入和修改了一些原有標(biāo)準(zhǔn),這一次筆者遇到的“declaration may not appear after executable statement in block”的問題,就可以采用C99標(biāo)準(zhǔn)來解決。文章來源:http://www.zghlxwxcb.cn/news/detail-726379.html
Keil中解決辦法
如下圖所示,點(diǎn)擊“小魔術(shù)棒”圖標(biāo),然后在C/C++菜單欄中將C99 Mode勾選即可。
作者:瀟灑的電磁波(專業(yè):射頻芯片設(shè)計、雷達(dá)系統(tǒng)、嵌入式。歡迎大家項(xiàng)目合作交流。)文章來源地址http://www.zghlxwxcb.cn/news/detail-726379.html
到了這里,關(guān)于Keil 報錯 declaration may not appear after executable statement in block的解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!