在使用ohos_shared_library编译动态链接库的时候,希望屏蔽掉unused-variable和unused-function的报错,在BUILD.gn中添加了cflags = ["-Wno-unused-variable","-Wno-unused-function"] 但编译时仍有报错,请问应该如何修改?

 

 

这个是打印出来的编译命令

/usr/bin/ccache ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang -MMD -MF obj/vendor/meig/slm500hs/camera/sensor/af_drv/dw9800/vcm_dw9800/vcm_dw9800.o.d -DV8_DEPRECATION_WARNINGS -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DCOMPONENT_BUILD -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../vendor/meig/slm500hs/camera/sensor/af_drv -I../../vendor/meig/slm500hs/camera/sensor/af_drv/dw9800 -I../../vendor/meig/slm500hs/camera/sensor/inc -I../../vendor/meig/slm500hs/camera/oem2v6/inc -I../../vendor/meig/slm500hs/camera/common/inc -I../../vendor/meig/slm500hs/camera/camdrv/isp2.3/isp_tune -I../../vendor/meig/slm500hs/camera/ispalg/isp2.x/common/inc -I../../vendor/meig/slm500hs/camera/camdrv/isp2.3/middleware/inc -I../../vendor/meig/slm500hs/camera/camdrv/isp2.3/driver/inc -I../../vendor/meig/slm500hs/camera/kernel_module/interface -I../../kernel/include/uapi/video -I../../vendor/meig/slm500hs/camera/video -I../../vendor/meig/slm500hs/camera/utils/camxmlparser/inc/libxml2 -I../../vendor/meig/slm500hs/camera/sensor/af_drv -I../../vendor/meig/slm500hs/camera/libcaminiparser -I../../drivers/hdf_core/framework/include/utils -I../../drivers/hdf_core/adapter/uhdf2/osal/include -Iobj/third_party/musl/usr/include/arm-linux-ohos -Ioverride/third_party -I../.. -Igen -I../../commonlibrary/c_utils/base/include -I../../third_party/bounds_checking_function/include -I../../base/hiviewdfx/hilog/interfaces/native/innerkits/include -g -O -fPIC -Wno-unused-variable -Wno-unused-function -Wno-unused-function -DSC_FPGA=0 -DCAMERA_SENSOR_TYPE_DEV_2=\"\\0\" -DAT_CAMERA_SENSOR_TYPE_DEV_2=\"\\0\" -DCONFIG_CAMERA_HAL_VERSION_1 -DCONFIG_CAMERA_ISP_AE_VERSION_V0 -DCONFIG_CAMERA_SHARKLE_BRINGUP -DCONFIG_CAMERA_SUPPORT_13M -DCONFIG_BACK_EXT_CAMERA_SUPPORT_5M -DCONFIG_FRONT_CAMERA_SUPPORT_5M -DCONFIG_BACK_CAMERA -DBACK_CAMERA_SENSOR_SUPPORT=1 -DCONFIG_FRONT_CAMERA -DFRONT_CAMERA_SENSOR_SUPPORT=1 -DBACK2_CAMERA_SENSOR_SUPPORT=0 -DFRONT2_CAMERA_SENSOR_SUPPORT=0 -DBACK3_CAMERA_SENSOR_SUPPORT=0 -DFRONT3_CAMERA_SENSOR_SUPPORT=0 -DCAMERA_SENSOR_NUM=2 -DOV8856_SHINE_MIPI_4LANE -DCONFIG_CAMERA_ISP -DCONFIG_ISP_2_3 -DCONFIG_CAMERA_PREVIEW_YV12 -DCONFIG_CAMERA_GYRO -DFRONT_CAMERA_FLASH_TYPE=\"none\" -DCONFIG_CAMERA_AUTOFOCUS_NOT_SUPPORT -DCONFIG_CAMERA_IMAGE_180 -DCONFIG_LOW_CAPTURE_MEM -DCAMERA_SENSOR_TYPE_BACK=\"s5k4h7_wifi5g\" -DCAMERA_SENSOR_TYPE_FRONT=\"gc02m2\" -DCAMERA_SENSOR_TYPE_BACK2=\"\" -DCAMERA_SENSOR_TYPE_FRONT2=\"\" -DCAMERA_SENSOR_TYPE_BACK3=\"\\0\" -DCAMERA_SENSOR_TYPE_FRONT3=\"\\0\" -DCONFIG_CAMERA_FLASH_OCP8137 -DCONFIG_CAMERA_PDAF_TYPE=3 -DCONFIG_CAMERA_FLASH_LED_0 -DCONFIG_CAMERA_FLASH_LED_1 -DCONFIG_DUAL_MODULE -DCHIP_ENDIAN_LITTLE\ -DJPEG_ENC -DCONFIG_CAMERA_AUTO_DETECT_SENSOR -DCAMERA_HIGH_FPS_MODE -DSPRD_SLOWMOTION_OPTIMIZE -DCAMERA_POWER_DEBUG_ENABLE -DCONFIG_AVAILABLE_FLASH_LEVEL=0 -DANDROID_VERSION_O_BRINGUP -DCONFIG_CAMERA_OFFLINE -DCONFIG_CAMERA_VIDEO_1920_1080 -DCAMERA_DATA_FILE=\"/data/misc/media\" -DCONFIG_CAMERA_MAX_PREVSIZE_1080P -DCAMERA_SENSOR_NUM=2 -DCAMERA_LOGICAL_SENSOR_NUM=0 -DISP_BINNING_SIZE=2 -DCONFIG_CAMERA_FACE_ROI -DCONFIG_HAS_CAMERA_HINTS_VERSION=0 -DPLATFORM_ID=0x0200 -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector-strong -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -ffunction-sections -fno-short-enums --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a -mfpu=neon -mthumb -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-error=unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -O2 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -gdwarf-3 -g2 -ggnu-pubnames -fno-common -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang --sysroot=obj/third_party/musl -c ../../vendor/meig/slm500hs/camera/sensor/af_drv/dw9800/vcm_dw9800.c -o obj/vendor/meig/slm500hs/camera/sensor/af_drv/dw9800/vcm_dw9800/vcm_dw9800.o
 

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐