<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69566>69566</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy check wit undeclared identifier '__builtin_ia32_pmaxsw128'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
xvjinkun
</td>
</tr>
</table>
<pre>
I have a c++ CMake project and I can compile normaly!Now I want to add clang-tidy check to this project,here is my soluction:
1. add clang-tidy to $Path
2. set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3.set(CMAKE_CXX_CLANG_TIDY ${clang_tidy_command};--config-file=${clang_tidy_config};)
4.add clang buildin header to stand include dir,avoid stdargs.h not found. set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include")
but unfortunately I compile failed this this error:
--------------- compile error begin ------------------
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:2228:19: error: use of undeclared identifier '__builtin_ia32_paddsb128'; did you mean '__builtin_ia32_phaddsw128'? [clang-diagnostic-error]
return (__m128i)__builtin_ia32_paddsb128((__v16qi)__a, (__v16qi)__b);
--------------- compile error begin ------------------
I try to add -msse -msse2 into my command but still got this error, here is my run command:
------------------------ command begin --------------------
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E __run_co_compile --tidy="/Applications/CLion.app/Contents/bin/clang/mac/clang-tidy;--config-file=/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/code_style/default/.clang-tidy;--extra-arg-before=--driver-mode=g++" --source=/Users/xvjinkun/Git/YunXiuDesktop/kernel/src/engine/processor/WaterMark.cpp -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DARCH_64 -DARKERNEL_STATIC -DARSPM_STATIC -DBUILDING_LIBCURL -DCMAKE_PLATFORM_MACOS=1 -DCMAKE_PLATFORM_OSX -DCMAKE_PLATFORM_OSX=1 -DCURL_STATICLIB -DGAMEPLAY_STATIC -DGLM_ENABLE_EXPERIMENTAL -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED -DHTTP_ONLY -DMEI_TU_IMAGE_CODEC=1 -DMTARBPM_STATIC -DMTARCPM_STATIC -DMTARMPM_STATIC -DMTLOG_STATIC -DNEW_LOG_MESSAGE -DPLATFORM_OSX -DQT_CORE_LIB -D_PROJECT_BUILD=37 -D_PROJECT_BUILD_TYPE=Alpha -D_PROJECT_PUBLISH_VERSION=6.1.0 -D_PROJECT_SUFFIX="" -D_PROJECT_VERSION=6.1.0 -I/Users/xvjinkun/Git/YunXiuDesktop/cmake-build-debug/kernel -I/Users/xvjinkun/Git/YunXiuDesktop/kernel -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libimagekit/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtlablog/default/apple/macos/static/release/universal/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libpygl/default/default/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtgl/default/default/macos/static/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libyuv/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libcurl/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/pc-release/default/mtcppupload/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libSentryReport/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libdataReport/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libarkernel/default/DEFAULT/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libarkernel/default/DEFAULT/macos-cpp/include -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtai/default/macOS -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtbeautycorehd/default/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtphotoeffect/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtphotocorrection/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtcameraraw/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtcamerarawhalide/default/libconvchroma/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libDetectFrameWork/default/SDK_manis/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libDetectFrameWork/default/SDK_manis/macOS/include/MTBase -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtlab-record/default/apple/macos/shared/release/universal -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtdlbeautydetector/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMTBeautyKernel/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtaibeautykernel/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtaibeauty/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtwrinkledet/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtfaceanalysis/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtfaceanalysis/default/macOS/include/FaceAnalysisOP -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtfaceanalysis/default/macOS/include/MTBase -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libfftw/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libfoodstyletransfer/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtteeth/default/macOS/include -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtface/default/macos -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmt3dface/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtcvlite/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtcvplus/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMTDLComponent/default/libMTDLComponent/macOS_manis/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmlog/default/static/macOS/MLog.framework/Headers -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMT3DApps/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmthairclassifier/default/libhairclassifier/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtikrteffect_empty/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtikmtee_empty/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtikaicodec_empty/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMTImageCodecs/default/macOS/include -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMerakInnovationRestoreTeethStatic/static/macOS -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMerak/static/macOS -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMerakCommon/static/macOS -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMerakDataToolUtil/static/macOS -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtlab-base/default/macos -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmanis/shared/macOS -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmanis/shared/macOS/Manis.framework/Headers -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmanis/shared/macOS/Manis.framework/Headers/deprecated -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtdlbeautybodyshape/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libsqlite/default/macOS/universal/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libappcia/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtrawkit/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/librawconvert/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libraw/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libjpeg-turbo/default/macOS/include -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libopencv/default/macos -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtdeclotheswrinkle/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libnewmtphotoeffect/default/apple/macos/static/release/universal/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libopenssl/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libassimp/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libbox2D/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libDragonBones/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libfreetype2/default/include/freetype2 -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libgameplay/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/liblua/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libPhysics/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libMT3DAnimoji/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtarbpm/empty/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtarcpm/empty/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtarmpm/empty/macos/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libarspm/default/macos/include -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/SDL2/default/macOS -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmthelp/default/apple/macos/static/release/universal/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtimage/default/include -I/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libprotobuf/default/macOS/include -I/Users/xvjinkun/Git/YunXiuDesktop/kernel/include -I/Users/xvjinkun/Git/YunXiuDesktop/database -I/Users/xvjinkun/Git/YunXiuDesktop/common/include -I/Users/xvjinkun/Git/YunXiuDesktop/kits/include -I/Users/xvjinkun/Git/YunXiuDesktop/database/sqlitebase -I/Users/xvjinkun/Git/YunXiuDesktop/qapp -iframework /Users/xvjinkun/Qt/main/clang_64/lib -isystem /Users/xvjinkun/Qt/main/clang_64/lib/QtCore.framework/Headers -isystem /Users/xvjinkun/Qt/main/clang_64/./mkspecs/macx-clang -isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=macro-redefined -Wno-macro-redefined -Wno-error=address-of-packed-member -Wno-address-of-packed-member -fno-aligned-allocation -ffunction-sections -fdata-sections -msse -msse2 -msse3 -msse4 -Wno-format-security -g -std=gnu++14 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=10.13 -fcolor-diagnostics -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libimagekit/default/macOS/lib -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmt3dface/default/macOS/lib -F/Users/xvjinkun/Git/YunXiuDesktop/3rdparty/modules/libmtrawkit/default/macOS/lib -Werror=return-type -Werror=pointer-bool-conversion -Werror=literal-conversion -Werror=empty-body -Werror=int-to-void-pointer-cast -Werror=uninitialized -Werror=sometimes-uninitialized -Werror=mismatched-new-delete -Werror=unsequenced -Werror=tautological-compare -Werror=format -Wno-address-of-packed-member -Wno-inconsistent-missing-override -Wno-deprecated-declarations -x objective-c++ -fPIC -MD -MT kernel/CMakeFiles/cb_kernel.dir/src/engine/processor/WaterMark.cpp.o -MF kernel/CMakeFiles/cb_kernel.dir/src/engine/processor/WaterMark.cpp.o.d -o kernel/CMakeFiles/cb_kernel.dir/src/engine/processor/WaterMark.cpp.o -c /Users/xvjinkun/Git/YunXiuDesktop/kernel/src/engine/processor/WaterMark.cpp
------------------------ command end --------------------
here is my environment:
OS: mac 12.6.4
cpu arch : x86_64
can anyone help me ?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMW1134izX_jXpCQuXJvbroAdqTMd3_Oit9p3OURaBHWUkkAFi6_Prn0Wi1ra2M9NHvacHWtkbrg3Z-9pAgBjDZxLgxjtve-fhGSnsXOmbp-UPLheFPEsUW9300JwsARFEPb_t-W3UGZAFoFyrH0AtIpKhHqJEIqqynAtAUumMiJXnN4bqEfXQI5EWWYUIY4gKImfYcrZCdA504crtnJtNc57fmYMGxA3KVsgoUVDLlfSCllcPvXqrUXvdjFXI85t3xM4rDb-GDFjPv-oMWl-7cffhbjSexp3R4K7X77rvQWsYTtBo6PnXVY2gtluh8_AQd_qt4W087YXfXdveZbvEix1eTFWWEcm8y9AL2hhTJVM-wykX4AXhHm0nrpS3gM3atg8oKbhgXKI5EAba9cZYN6RcUlEwQIxrz--QpeIMGcuInpnaHEllUaoKyV521tk-mbaGYWscxr1hp38f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