Contents ...
udn網路城邦
warnning of " this statement may fall through [-Wimplicit-fallthrough=]"
2022/03/15 11:25
瀏覽80
迴響0
推薦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;


全站分類:不分類 不分類
自訂分類:linux_cc
上一則: 常用反組譯
下一則: Makefile hello module ko

限會員,要發表迴響,請先登入