CallStack Android Native systemcoreincludeandroidlog.h:120:20: error: ‘

tech2026-08-29  1

Android Native 代码加入CallStack 时,编译报错

In file included from system/core/include/utils/CallStack.h:20: system/core/include/android/log.h:120:20: error: '__format__' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((__format__(printf, 3, 4))) ^ system/core/include/android/log.h:138:20: error: '__format__' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((__format__(printf, 3, 0))) ^ system/core/include/android/log.h:169:20: error: '__format__' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((__format__(printf, 3, 4))) ^ system/core/include/android/log.h:200:20: error: '__format__' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((__format__(printf, 4, 5))) ^ In file included from vendor/nxp/fsl_imx_omx/OpenMAXIL/src/component/v4l2_common/V4l2Object.cpp:12: In file included from system/core/include/utils/CallStack.h:22: system/core/include/utils/String8.h:65:77: error: 'format' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); ^ system/core/include/utils/String8.h:95:36: error: 'format' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((format (printf, 2, 3))); ^ In file included from vendor/nxp/fsl_imx_omx/OpenMAXIL/src/component/v4l2_common/V4l2Object.cpp:12: In file included from system/core/include/utils/CallStack.h:23: In file included from system/core/include/utils/Vector.h:23: In file included from system/core/include/log/log.h:31: system/core/include/log/log_id.h:52:20: error: '__format__' attribute argument not supported: LogOutput [-Werror,-Wignored-attributes] __attribute__((__format__(printf, 4, 5)))

将#include <utils/CallStack.h>放到cpp文件最上方,问题消息

最新回复(0)