```
Available schemes are:
-fsanitize=cfi-cast-strict: Enables strict cast checks.
-fsanitize=cfi-derived-cast: Base-to-derived cast to the wrong dynamic type.
-fsanitize=cfi-unrelated-cast: Cast from void* or another unrelated type to the wrong dynamic type.
-fsanitize=cfi-nvcall: Non-virtual call via an object whose vptr is of the wrong dynamic type.
-fsanitize=cfi-vcall: Virtual call via an object whose vptr is of the wrong dynamic type.
-fsanitize=cfi-icall: Indirect call of a function with wrong dynamic type.
-fsanitize=cfi-mfcall: Indirect call via a member function pointer with wrong dynamic type.
```
// foundation/communication/wifi/wifi/frameworks/js/napi/src/wifi_napi_device.cpp
NO_SANITIZE("cfi") napi_value EnableWifi(napi_env env, napi_callback_info info)
{
TRACE_FUNC_CALL;
WIFI_NAPI_ASSERT(env, wifiDevicePtr != nullptr, WIFI_OPT_FAILED, SYSCAP_WIFI_STA);
ErrCode ret = wifiDevicePtr->EnableWifi();
WIFI_NAPI_RETURN(env, ret == WIFI_OPT_SUCCESS, ret, SYSCAP_WIFI_STA);
}
```
2. 在定义里增加no\_trap,方便调试,不至于程序直接奔溃
```
By default, CFI will abort the program immediately upon detecting a control flow integrity violation. You can use the -fno-sanitize-trap= flag to cause CFI to print a diagnostic similar to the one below before the program aborts.
If diagnostics are enabled, you can also configure CFI to continue program execution instead of aborting by using the -fsanitize-recover= flag.