網路城邦
上一篇 回創作列表 下一篇   字體:
warnning of " this statement may fall through [-Wimplicit-fallthrough=]"
2022/03/15 11:25:10瀏覽75|回應0|推薦0

When compiling the code, get warnning of " this statement may fall through [-Wimplicit-fallthrough=]" 

CC [M]  /home/ai7688//0303a/rtl8192eu__wangqiang1588/hal/hal_intf.o
/home/ai7688//0303a/rtl8192eu__wangqiang1588/hal/hal_intf.c: In function c2h_handler:
/home/ai7688//0303a/rtl8192eu__wangqiang1588/hal/hal_intf.c:1078:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   sub_id = payload[0];
   ~~~~~~~^~~~~~~~~~~~
/home/ai7688//0303a/rtl8192eu__wangqiang1588/hal/hal_intf.c:1082:2: note: here
  default:
  ^~~~~~~

add

/* fallthrough */

change code from


    case C2H_EXTEND:
        sub_id = payload[0];
        /* no handle, goto default */


    default:
        if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
            ret = _FAIL;
        break;


to


    case C2H_EXTEND:
        sub_id = payload[0];
        /* no handle, goto default */
        /* fallthrough */

    default:
        if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
            ret = _FAIL;
        break;


( 不分類不分類 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=greatcat&aid=172022394