vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

clang-tidy warnings with xmmintrin.h

Open arghness opened this issue 1 year ago • 1 comments

Environment

  • OS and Version: Windows 11
  • VS Code Version: 1.86.2
  • C/C++ Extension Version: 1.18.5 (also tested with 1.19.3 pre-release)
  • If using SSH remote, specify OS of remote machine: Rocky Linux 8.7 with default gcc 8.5.0

Bug Summary and Steps to Reproduce

Bug Summary: Running code analysis on a file including <xmmintrin.h> triggers clang diagnostic errors:

image

This appears to be similar diagnostic errors as #9898 , but I have tried setting useBuildPath=true and still get the errors.

Steps to reproduce:

  1. Have the following files: main.cpp:
#include <xmmintrin.h>

int main(int, char**){
  return 0;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.0.0)
project(test_xmmintrin VERSION 0.1.0 LANGUAGES C CXX)

add_executable(test_xmmintrin)

target_sources(
  test_xmmintrin
  PRIVATE
    main.cpp
)

CMakePresets.json:

{
  "version": 2,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 20
  },
  "configurePresets": [
    {
      "name": "default",
      "displayName": "default",
      "generator": "Unix Makefiles",
      "binaryDir": "${sourceDir}/obj",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "default",
      "displayName": "default",
      "configurePreset": "default"
    }
  ]
}

.vscode/settings.json:

{
  "cmake.useCMakePresets": "always",
  "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
  1. Configure the CMake project with the "default" configuration preset.
  2. Open main.cpp and run code analysis on active file to see problem.

Expected behavior: No problems.

Configuration and Logs

See configurations in summary.

C/C++: Log Diagnostics:

-------- Diagnostics - 2/20/2024, 4:42:42 PM
Version: 1.18.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/data/dev/home/asimpson/test_xmmintrin/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c17",
    "cppStandard": "gnu++14",
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "/data/dev/home/asimpson/test_xmmintrin/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        "/data/dev/home/asimpson/test_xmmintrin"
    ],
    "compilerPath": "/usr/bin/c++",
    "compilerArgs": [],
    "compilerFragments": [
        "-g"
    ]
}
Custom configurations:
[ /data/dev/home/asimpson/test_xmmintrin/main.cpp ]
{
    "includePath": [],
    "defines": [],
    "compilerPath": "/usr/bin/c++",
    "compilerArgs": [],
    "compilerFragments": [
        "-g"
    ]
}
cpptools version (native): 1.18.3.0
Translation Unit Mappings:
[ /data/dev/home/asimpson/test_xmmintrin/main.cpp ]:
    /data/dev/home/asimpson/test_xmmintrin/main.cpp
Translation Unit Configurations:
[ /data/dev/home/asimpson/test_xmmintrin/main.cpp ]:
    Process ID: 2671094
    Memory Usage: 14 MB
    Compiler Path: /usr/bin/c++
    Includes:
        /usr/include/c++/8
        /usr/include/c++/8/x86_64-redhat-linux
        /usr/include/c++/8/backward
        /usr/lib/gcc/x86_64-redhat-linux/8/include
        /usr/local/include
        /usr/include
    Standard Version: c++14
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --g++
        --gnu_version=80500
Total Memory Usage: 14 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 3016
Number of files parsed: 2

language server logging:

loggingLevel: Debug
loggingLevel has changed to: Debug
LSP: (invoked) cpptools/didChangeCppProperties (id: 33)
LSP: (received) cpptools/getCodeActions: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp (id: 34)
LSP: (received) cpptools/activeDocumentChange: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp
LSP: (invoked) cpptools/getCodeActions: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp (id: 34)
LSP: (received) cpptools/textEditorSelectionChange
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/activeDocumentChange: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getFoldingRanges: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp (id: 35)
LSP: (invoked) cpptools/getFoldingRanges: file:///data/dev/home/asimpson/test_xmmintrin/main.cpp (id: 35)
LSP: (received) cpptools/runCodeAnalysis
LSP: (invoked) cpptools/runCodeAnalysis
/data/dev/home/asimpson/vscode_server/rocky8-dev-tip-master-asimpson/.vscode-server/extensions/ms-vscode.cpptools-1.18.5-linux-x64/bin/../LLVM/bin/clang-tidy
--header-filter=/data/dev/home/asimpson/test_xmmintrin
--export-fixes=/tmp/{15101656299240107547}/fixes139666069932848.yaml
--quiet
--use-color=false
/data/dev/home/asimpson/test_xmmintrin/main.cpp
--
-std=gnu++14
-xc++
-Wno-pragma-pack
-Wno-pragma-once-outside-header
-D__DBL_MIN_EXP__=(-1021)
-D__FLT32X_MAX_EXP__=1024
-D__cpp_attributes=200809
-D__UINT_LEAST16_MAX__=0xffff
-D__ATOMIC_ACQUIRE=2
-D__FLT128_MAX_10_EXP__=4932
-D__FLT_MIN__=1.17549435082228750796873653722224568e-38F
-D__GCC_IEC_559_COMPLEX=2
-D__cpp_aggregate_nsdmi=201304
-D__UINT_LEAST8_TYPE__=unsigned char
-D__INTMAX_C(c)=c ## L
-D__CHAR_BIT__=8
-D__UINT8_MAX__=0xff
-D__WINT_MAX__=0xffffffffU
-D__FLT32_MIN_EXP__=(-125)
-D__cpp_static_assert=200410
-D__ORDER_LITTLE_ENDIAN__=1234
-D__SIZE_MAX__=0xffffffffffffffffUL
-D__WCHAR_MAX__=0x7fffffff
-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1
-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1
-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1
-D__DBL_DENORM_MIN__=double(4.94065645841246544176568792868221372e-324L)
-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1
-D__GCC_ATOMIC_CHAR_LOCK_FREE=2
-D__GCC_IEC_559=2
-D__FLT32X_DECIMAL_DIG__=17
-D__FLT_EVAL_METHOD__=0
-D__unix__=1
-D__cpp_binary_literals=201304
-D__FLT64_DECIMAL_DIG__=17
-D__GCC_ATOMIC_CHAR32_T_LOCK_FREE=2
-D__x86_64=1
-D__cpp_variadic_templates=200704
-D__UINT_FAST64_MAX__=0xffffffffffffffffUL
-D__SIG_ATOMIC_TYPE__=int
-D__DBL_MIN_10_EXP__=(-307)
-D__FINITE_MATH_ONLY__=0
-D__cpp_variable_templates=201304
-D__FLT32_HAS_DENORM__=1
-D__UINT_FAST8_MAX__=0xff
-D__DEC64_MAX_EXP__=385
-D__INT8_C(c)=c
-D__INT_LEAST8_WIDTH__=8
-D__UINT_LEAST64_MAX__=0xffffffffffffffffUL
-D__SHRT_MAX__=0x7fff
-D__LDBL_MAX__=1.18973149535723176502126385303097021e+4932L
-D__FLT64X_MAX_10_EXP__=4932
-D__UINT_LEAST8_MAX__=0xff
-D__GCC_ATOMIC_BOOL_LOCK_FREE=2
-D__FLT128_DENORM_MIN__=6.47517511943802511092443895822764655e-4966F128
-D__UINTMAX_TYPE__=long unsigned int
-D__linux=1
-D__DEC32_EPSILON__=1E-6DF
-D__FLT_EVAL_METHOD_TS_18661_3__=0
-D__unix=1
-D__UINT32_MAX__=0xffffffffU
-D__GXX_EXPERIMENTAL_CXX0X__=1
-D__LDBL_MAX_EXP__=16384
-D__FLT128_MIN_EXP__=(-16381)
-D__WINT_MIN__=0U
-D__linux__=1
-D__FLT128_MIN_10_EXP__=(-4931)
-D__INT_LEAST16_WIDTH__=16
-D__SCHAR_MAX__=0x7f
-D__FLT128_MANT_DIG__=113
-D__WCHAR_MIN__=(-__WCHAR_MAX__ - 1)
-D__INT64_C(c)=c ## L
-D__DBL_DIG__=15
-D__GCC_ATOMIC_POINTER_LOCK_FREE=2
-D__FLT64X_MANT_DIG__=64
-D__SIZEOF_INT__=4
-D__SIZEOF_POINTER__=8
-D__GCC_ATOMIC_CHAR16_T_LOCK_FREE=2
-D__USER_LABEL_PREFIX__=
-D__FLT64X_EPSILON__=1.08420217248550443400745280086994171e-19F64x
-D__STDC_HOSTED__=1
-D__LDBL_HAS_INFINITY__=1
-D__FLT32_DIG__=6
-D__FLT_EPSILON__=1.19209289550781250000000000000000000e-7F
-D__GXX_WEAK__=1
-D__SHRT_WIDTH__=16
-D__LDBL_MIN__=3.36210314311209350626267781732175260e-4932L
-D__DEC32_MAX__=9.999999E96DF
-D__cpp_threadsafe_static_init=200806
-D__FLT64X_DENORM_MIN__=3.64519953188247460252840593361941982e-4951F64x
-D__FLT32X_HAS_INFINITY__=1
-D__INT32_MAX__=0x7fffffff
-D__INT_WIDTH__=32
-D__SIZEOF_LONG__=8
-D__STDC_IEC_559__=1
-D__STDC_ISO_10646__=201706L
-D__UINT16_C(c)=c
-D__PTRDIFF_WIDTH__=64
-D__DECIMAL_DIG__=21
-D__FLT64_EPSILON__=2.22044604925031308084726333618164062e-16F64
-D__gnu_linux__=1
-D__INTMAX_WIDTH__=64
-D__FLT64_MIN_EXP__=(-1021)
-D__FLT64X_MIN_10_EXP__=(-4931)
-D__LDBL_HAS_QUIET_NAN__=1
-D__FLT64_MANT_DIG__=53
-D__GXX_RTTI=1
-D__MMX__=1
-D__cpp_delegating_constructors=200604
-D__FLT_HAS_DENORM__=1
-D__SIZEOF_LONG_DOUBLE__=16
-D__BIGGEST_ALIGNMENT__=16
-D__STDC_UTF_16__=1
-D__FLT64_MAX_10_EXP__=308
-D__FLT32_HAS_INFINITY__=1
-D__DBL_MAX__=double(1.79769313486231570814527423731704357e+308L)
-D__cpp_raw_strings=200710
-D__INT_FAST32_MAX__=0x7fffffffffffffffL
-D__DBL_HAS_INFINITY__=1
-D__DEC32_MIN_EXP__=(-94)
-D__INTPTR_WIDTH__=64
-D__FLT32X_HAS_DENORM__=1
-D__INT_FAST16_TYPE__=long int
-D__LDBL_HAS_DENORM__=1
-D__cplusplus=201402L
-D__cpp_ref_qualifiers=200710
-D__DEC128_MAX__=9.999999999999999999999999999999999E6144DL
-D__INT_LEAST32_MAX__=0x7fffffff
-D__DEC32_MIN__=1E-95DF
-D__DEPRECATED=1
-D__cpp_rvalue_references=200610
-D__DBL_MAX_EXP__=1024
-D__WCHAR_WIDTH__=32
-D__FLT32_MAX__=3.40282346638528859811704183484516925e+38F32
-D__DEC128_EPSILON__=1E-33DL
-D__ATOMIC_HLE_RELEASE=131072
-D__PTRDIFF_MAX__=0x7fffffffffffffffL
-D__amd64=1
-D__ATOMIC_HLE_ACQUIRE=65536
-D__FLT32_HAS_QUIET_NAN__=1
-D__GNUG__=8
-D__LONG_LONG_MAX__=0x7fffffffffffffffLL
-D__SIZEOF_SIZE_T__=8
-D__cpp_rvalue_reference=200610
-D__cpp_nsdmi=200809
-D__FLT64X_MIN_EXP__=(-16381)
-D__SIZEOF_WINT_T__=4
-D__LONG_LONG_WIDTH__=64
-D__cpp_initializer_lists=200806
-D__FLT32_MAX_EXP__=128
-D__cpp_hex_float=201603
-D__GCC_HAVE_DWARF2_CFI_ASM=1
-D__GXX_ABI_VERSION=1013
-D__FLT128_HAS_INFINITY__=1
-D__FLT_MIN_EXP__=(-125)
-D__cpp_lambdas=200907
-D__FLT64X_HAS_QUIET_NAN__=1
-D__INT_FAST64_TYPE__=long int
-D__FLT64_DENORM_MIN__=4.94065645841246544176568792868221372e-324F64
-D__DBL_MIN__=double(2.22507385850720138309023271733240406e-308L)
-D__LP64__=1
-D__FLT32X_EPSILON__=2.22044604925031308084726333618164062e-16F32x
-D__DECIMAL_BID_FORMAT__=1
-D__FLT64_MIN_10_EXP__=(-307)
-D__FLT64X_DECIMAL_DIG__=21
-D__DEC128_MIN__=1E-6143DL
-D__REGISTER_PREFIX__=
-D__UINT16_MAX__=0xffff
-D__DBL_HAS_DENORM__=1
-D__FLT32_MIN__=1.17549435082228750796873653722224568e-38F32
-D__UINT8_TYPE__=unsigned char
-D__NO_INLINE__=1
-D__FLT_MANT_DIG__=24
-D__LDBL_DECIMAL_DIG__=21
-D__UINT64_C(c)=c ## UL
-D__cpp_unicode_characters=200704
-D_STDC_PREDEF_H=1
-D__cpp_decltype_auto=201304
-D__GCC_ATOMIC_INT_LOCK_FREE=2
-D__FLT128_MAX_EXP__=16384
-D__FLT32_MANT_DIG__=24
-D__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__
-D__STDC_IEC_559_COMPLEX__=1
-D__FLT128_HAS_DENORM__=1
-D__FLT128_DIG__=33
-D__SCHAR_WIDTH__=8
-D__INT32_C(c)=c
-D__DEC64_EPSILON__=1E-15DD
-D__ORDER_PDP_ENDIAN__=3412
-D__DEC128_MIN_EXP__=(-6142)
-D__FLT32_MAX_10_EXP__=38
-D__INT_FAST32_TYPE__=long int
-D__UINT_LEAST16_TYPE__=short unsigned int
-D__FLT64X_HAS_INFINITY__=1
-Dunix=1
-D__INT16_MAX__=0x7fff
-D__cpp_rtti=199711
-D__SIZE_TYPE__=long unsigned int
-D__UINT64_MAX__=0xffffffffffffffffUL
-D__FLT64X_DIG__=18
-D__INT8_TYPE__=signed char
-D__cpp_digit_separators=201309
-D__ELF__=1
-D__GCC_ASM_FLAG_OUTPUTS__=1
-D__FLT_RADIX__=2
-D__INT_LEAST16_TYPE__=short int
-D__LDBL_EPSILON__=1.08420217248550443400745280086994171e-19L
-D__UINTMAX_C(c)=c ## UL
-D__GNUC_RH_RELEASE__=18
-D__GLIBCXX_BITSIZE_INT_N_0=128
-D__k8=1
-D__SIG_ATOMIC_MAX__=0x7fffffff
-D__GCC_ATOMIC_WCHAR_T_LOCK_FREE=2
-D__SIZEOF_PTRDIFF_T__=8
-D__FLT32X_MANT_DIG__=53
-D__x86_64__=1
-D__FLT32X_MIN_EXP__=(-1021)
-D__DEC32_SUBNORMAL_MIN__=0.000001E-95DF
-D__INT_FAST16_MAX__=0x7fffffffffffffffL
-D__FLT64_DIG__=15
-D__UINT_FAST32_MAX__=0xffffffffffffffffUL
-D__UINT_LEAST64_TYPE__=long unsigned int
-D__FLT_HAS_QUIET_NAN__=1
-D__FLT_MAX_10_EXP__=38
-D__LONG_MAX__=0x7fffffffffffffffL
-D__FLT64X_HAS_DENORM__=1
-D__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL
-D__FLT_HAS_INFINITY__=1
-D__cpp_unicode_literals=200710
-D__UINT_FAST16_TYPE__=long unsigned int
-D__DEC64_MAX__=9.999999999999999E384DD
-D__INT_FAST32_WIDTH__=64
-D__CHAR16_TYPE__=short unsigned int
-D__PRAGMA_REDEFINE_EXTNAME=1
-D__SIZE_WIDTH__=64
-D__SEG_FS=1
-D__INT_LEAST16_MAX__=0x7fff
-D__DEC64_MANT_DIG__=16
-D__INT64_MAX__=0x7fffffffffffffffL
-D__UINT_LEAST32_MAX__=0xffffffffU
-D__SEG_GS=1
-D__FLT32_DENORM_MIN__=1.40129846432481707092372958328991613e-45F32
-D__GCC_ATOMIC_LONG_LOCK_FREE=2
-D__SIG_ATOMIC_WIDTH__=32
-D__INT_LEAST64_TYPE__=long int
-D__INT16_TYPE__=short int
-D__INT_LEAST8_TYPE__=signed char
-D__DEC32_MAX_EXP__=97
-D__INT_FAST8_MAX__=0x7f
-D__FLT128_MAX__=1.18973149535723176508575932662800702e+4932F128
-D__INTPTR_MAX__=0x7fffffffffffffffL
-Dlinux=1
-D__cpp_range_based_for=200907
-D__FLT64_HAS_QUIET_NAN__=1
-D__FLT32_MIN_10_EXP__=(-37)
-D__EXCEPTIONS=1
-D__LDBL_MANT_DIG__=64
-D__DBL_HAS_QUIET_NAN__=1
-D__FLT64_HAS_INFINITY__=1
-D__FLT64X_MAX__=1.18973149535723176502126385303097021e+4932F64x
-D__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)
-D__code_model_small__=1
-D__cpp_return_type_deduction=201304
-D__k8__=1
-D__INTPTR_TYPE__=long int
-D__UINT16_TYPE__=short unsigned int
-D__WCHAR_TYPE__=int
-D__SIZEOF_FLOAT__=4
-D__UINTPTR_MAX__=0xffffffffffffffffUL
-D__INT_FAST64_WIDTH__=64
-D__DEC64_MIN_EXP__=(-382)
-D__cpp_decltype=200707
-D__FLT32_DECIMAL_DIG__=9
-D__INT_FAST64_MAX__=0x7fffffffffffffffL
-D__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1
-D__FLT_DIG__=6
-D__FLT64X_MAX_EXP__=16384
-D__UINT_FAST64_TYPE__=long unsigned int
-D__INT_MAX__=0x7fffffff
-D__amd64__=1
-D__INT64_TYPE__=long int
-D__FLT_MAX_EXP__=128
-D__ORDER_BIG_ENDIAN__=4321
-D__DBL_MANT_DIG__=53
-D__cpp_inheriting_constructors=201511
-D__SIZEOF_FLOAT128__=16
-D__INT_LEAST64_MAX__=0x7fffffffffffffffL
-D__DEC64_MIN__=1E-383DD
-D__WINT_TYPE__=unsigned int
-D__UINT_LEAST32_TYPE__=unsigned int
-D__SIZEOF_SHORT__=2
-D__LDBL_MIN_EXP__=(-16381)
-D__FLT64_MAX__=1.79769313486231570814527423731704357e+308F64
-D__WINT_WIDTH__=32
-D__INT_LEAST8_MAX__=0x7f
-D__FLT32X_MAX_10_EXP__=308
-D__SIZEOF_INT128__=16
-D__LDBL_MAX_10_EXP__=4932
-D__ATOMIC_RELAXED=0
-D__DBL_EPSILON__=double(2.22044604925031308084726333618164062e-16L)
-D__FLT128_MIN__=3.36210314311209350626267781732175260e-4932F128
-D_LP64=1
-D__UINT8_C(c)=c
-D__FLT64_MAX_EXP__=1024
-D__INT_LEAST32_TYPE__=int
-D__SIZEOF_WCHAR_T__=4
-D__FLT128_HAS_QUIET_NAN__=1
-D__INT_FAST8_TYPE__=signed char
-D__FLT64X_MIN__=3.36210314311209350626267781732175260e-4932F64x
-D__GNUC_STDC_INLINE__=1
-D__FLT64_HAS_DENORM__=1
-D__FLT32_EPSILON__=1.19209289550781250000000000000000000e-7F32
-D__DBL_DECIMAL_DIG__=17
-D__STDC_UTF_32__=1
-D__INT_FAST8_WIDTH__=8
-D__FXSR__=1
-D__DEC_EVAL_METHOD__=2
-D__FLT32X_MAX__=1.79769313486231570814527423731704357e+308F32x
-D__cpp_runtime_arrays=198712
-D__UINT64_TYPE__=long unsigned int
-D__UINT32_C(c)=c ## U
-D__INTMAX_MAX__=0x7fffffffffffffffL
-D__cpp_alias_templates=200704
-D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__
-D__FLT_DENORM_MIN__=1.40129846432481707092372958328991613e-45F
-D__INT8_MAX__=0x7f
-D__LONG_WIDTH__=64
-D__UINT_FAST32_TYPE__=long unsigned int
-D__CHAR32_TYPE__=unsigned int
-D__FLT_MAX__=3.40282346638528859811704183484516925e+38F
-D__cpp_constexpr=201304
-D__INT32_TYPE__=int
-D__SIZEOF_DOUBLE__=8
-D__cpp_exceptions=199711
-D__FLT_MIN_10_EXP__=(-37)
-D__FLT64_MIN__=2.22507385850720138309023271733240406e-308F64
-D__INT_LEAST32_WIDTH__=32
-D__INTMAX_TYPE__=long int
-D__DEC128_MAX_EXP__=6145
-D__FLT32X_HAS_QUIET_NAN__=1
-D__ATOMIC_CONSUME=1
-D__GLIBCXX_TYPE_INT_N_0=__int128
-D__INT_FAST16_WIDTH__=64
-D__UINTMAX_MAX__=0xffffffffffffffffUL
-D__DEC32_MANT_DIG__=7
-D__FLT32X_DENORM_MIN__=4.94065645841246544176568792868221372e-324F32x
-D__DBL_MAX_10_EXP__=308
-D__LDBL_DENORM_MIN__=3.64519953188247460252840593361941982e-4951L
-D__INT16_C(c)=c
-D__cpp_generic_lambdas=201304
-D__STDC__=1
-D__FLT32X_DIG__=15
-D__PTRDIFF_TYPE__=long int
-D__ATOMIC_SEQ_CST=5
-D__UINT32_TYPE__=unsigned int
-D__FLT32X_MIN_10_EXP__=(-307)
-D__UINTPTR_TYPE__=long unsigned int
-D__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD
-D__DEC128_MANT_DIG__=34
-D__LDBL_MIN_10_EXP__=(-4931)
-D__FLT128_EPSILON__=1.92592994438723585305597794258492732e-34F128
-D__SIZEOF_LONG_LONG__=8
-D__cpp_user_defined_literals=200809
-D__FLT128_DECIMAL_DIG__=36
-D__GCC_ATOMIC_LLONG_LOCK_FREE=2
-D__FLT32X_MIN__=2.22507385850720138309023271733240406e-308F32x
-D__LDBL_DIG__=18
-D__FLT_DECIMAL_DIG__=9
-D__UINT_FAST16_MAX__=0xffffffffffffffffUL
-D__GCC_ATOMIC_SHORT_LOCK_FREE=2
-D__INT_LEAST64_WIDTH__=64
-D__UINT_FAST8_TYPE__=unsigned char
-D_GNU_SOURCE=1
-D__cpp_init_captures=201304
-D__ATOMIC_ACQ_REL=4
-D__ATOMIC_RELEASE=3
-isystem/usr/include/c++/8
-isystem/usr/include/c++/8/x86_64-redhat-linux
-isystem/usr/include/c++/8/backward
-isystem/usr/lib/gcc/x86_64-redhat-linux/8/include
-isystem/usr/local/include
-isystem/usr/include
Error while processing /data/dev/home/asimpson/test_xmmintrin/main.cpp.
warning: redefining builtin macro [clang-diagnostic-builtin-macro-redefined]
error: too many errors emitted, stopping now [clang-diagnostic-error]
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:130:19: error: use of undeclared identifier '__builtin_ia32_addss' [clang-diagnostic-error]
  130 |   return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:136:19: error: use of undeclared identifier '__builtin_ia32_subss' [clang-diagnostic-error]
  136 |   return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:142:19: error: use of undeclared identifier '__builtin_ia32_mulss' [clang-diagnostic-error]
  142 |   return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:148:19: error: use of undeclared identifier '__builtin_ia32_divss'; did you mean '__builtin_ia32_minss'? [clang-diagnostic-error]
  148 |   return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:142:19: note: '__builtin_ia32_minss' declared here
  142 |   return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:242:10: error: use of undeclared identifier '__builtin_ia32_andps'; did you mean '__builtin_ia32_haddps'? [clang-diagnostic-error]
  242 |   return __builtin_ia32_andps (__A, __B);
      |          ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:242:10: note: '__builtin_ia32_haddps' declared here
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:248:10: error: use of undeclared identifier '__builtin_ia32_andnps' [clang-diagnostic-error]
  248 |   return __builtin_ia32_andnps (__A, __B);
      |          ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:254:10: error: use of undeclared identifier '__builtin_ia32_orps' [clang-diagnostic-error]
  254 |   return __builtin_ia32_orps (__A, __B);
      |          ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:260:10: error: use of undeclared identifier '__builtin_ia32_xorps' [clang-diagnostic-error]
  260 |   return __builtin_ia32_xorps (__A, __B);
      |          ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:288:19: error: use of undeclared identifier '__builtin_ia32_movss' [clang-diagnostic-error]
  288 |   return (__m128) __builtin_ia32_movss ((__v4sf) __A,
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:298:19: error: use of undeclared identifier '__builtin_ia32_movss' [clang-diagnostic-error]
  298 |   return (__m128) __builtin_ia32_movss ((__v4sf) __A,
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:326:19: error: use of undeclared identifier '__builtin_ia32_movss' [clang-diagnostic-error]
  326 |   return (__m128) __builtin_ia32_movss ((__v4sf) __A,
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:336:19: error: use of undeclared identifier '__builtin_ia32_movss' [clang-diagnostic-error]
  336 |   return (__m128) __builtin_ia32_movss ((__v4sf) __A,
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:380:19: error: use of undeclared identifier '__builtin_ia32_cmpgtps'; did you mean '__builtin_ia32_cmpltps'? [clang-diagnostic-error]
  380 |   return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:368:19: note: '__builtin_ia32_cmpltps' declared here
  368 |   return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:386:19: error: use of undeclared identifier '__builtin_ia32_cmpgeps'; did you mean '__builtin_ia32_cmpleps'? [clang-diagnostic-error]
  386 |   return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:374:19: note: '__builtin_ia32_cmpleps' declared here
  374 |   return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:410:19: error: use of undeclared identifier '__builtin_ia32_cmpngtps'; did you mean '__builtin_ia32_cmpnltps'? [clang-diagnostic-error]
  410 |   return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:380:19: note: '__builtin_ia32_cmpnltps' declared here
  380 |   return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:416:19: error: use of undeclared identifier '__builtin_ia32_cmpngeps'; did you mean '__builtin_ia32_cmpnleps'? [clang-diagnostic-error]
  416 |   return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:404:19: note: '__builtin_ia32_cmpnleps' declared here
  404 |   return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:602:19: error: use of undeclared identifier '__builtin_ia32_cvtsi2ss'; did you mean '__builtin_ia32_cvtsd2ss'? [clang-diagnostic-error]
  602 |   return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:602:19: note: '__builtin_ia32_cvtsd2ss' declared here
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:602:58: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(double)))) double' (vector of 2 'double' values) with an lvalue of type 'int' [clang-diagnostic-error]
  602 |   return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B);
      |                                                          ^~~
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:618:19: error: use of undeclared identifier '__builtin_ia32_cvtsi642ss'; did you mean '__builtin_ia32_cvtsd2ss'? [clang-diagnostic-error]
  618 |   return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B);
      |                   ^
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h:602:19: note: '__builtin_ia32_cvtsd2ss' declared here
  602 |   return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B);
      |                   ^


### Other Extensions

CMake tools version 1.17.15

### Additional context

_No response_

arghness avatar Feb 20 '24 16:02 arghness

@arghness Clang doesn't define __builtin_ia32_addss so a fix or work would involve setting some define to cause those built-in functions to be skipped, but what those defines are depends the exact headers you're using what they're conditioned based on. If the xmmintrin.h file doesn't conditionalize use of those builtins then any header that #include those would need to be conditionalized based on some define (such as __clang__).

sean-mcmanus avatar Feb 20 '24 19:02 sean-mcmanus

@sean-mcmanus Thanks, that's a great help. ~~Is there a way to add any command line options to clang-tidy after the "--" (with macros, includes etc)? C_Cpp.codeAnalysis.clangTidy.args seems to add them before. That would be the cleanest way for me to work around this, if it's possible, otherwise I'll have to look at other options.~~

~~My actual use-case that triggers this is in the rapidjson library, so I could undefine the macro that enables SIMD with "-U", or alternatively add a CMake configuration option to generate a new config specifically for clang-tidy that does not enable it before I run clang-tidy.~~

Actually the above does not work, -U isn't passed through from cmake tools, and there are other places where I do not appear able to disable this (e.g. in boost multiprecision, used by a 3rd party library, where I can't see any reasonable way to disable the intrinsics, as it's based on the existence of the header file, and some compiler-defined macros). I guess the only workaround might be to have a full clang install that would have an intrinsic file it works with, and make a configuration to handle that.

arghness avatar Feb 21 '24 10:02 arghness