【linux】a label can only be part of a statement and a declaration is not a statement

【問題描述】
修改驅動程序後,編譯內核報錯:“a label can only be part of a statement and a declaration is not a statement”。

【問題定位】
增加的一行代碼是在switch語句的一個分支中,該分支內的語句沒有放在大括號“{}”裏。

【解決方案】
在分支內增加大括號,將概括號內的所有代碼括起來。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章