clang-tidy fails on code in platform.io
Environment
- OS and Version: windows 10 22H2
- VS Code Version: 1.7.43
- C/C++ Extension Version: 1.14.0
Bug Summary and Steps to Reproduce
Bug Summary:
i'm trying to use clan-tidy in platfrom io (because unlike pio check this gives me immidiate incremental checks) however clang tidy keeps failing on errors in arduion file, a debug command shows this: no matter what i do i cannot seem to have it ignore that avr include files.. c_cpp_properties.txt
Configuration and Logs
i'm trying to use clan-tidy in platfrom io (because unlike pio check this gives me immidiate incremental checks)
however clang tidy keeps failing on errors in arduion file, a debug command shows this:
no matter what i do i cannot seem to have it ignore that avr include files..
c:\Users\User\.vscode\extensions\ms-vscode.cpptools-1.14.0-win32-x64/bin/../LLVM/bin/clang-tidy.exe
--header-filter=(C:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/**|C:\\Users\\User\\Documents\\PlatformIO\\Projects\\JewishClock\\HClock\\**)
--extra-arg=-nostdinc
--extra-arg=-nostdinc++
--export-fixes=C:\Users\User\AppData\Local\Temp11325916048226707295\fixes126344.yaml
--quiet
C:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/src/main-master.cpp
--
-std=c++11
-xc++
-Wno-pragma-pack
-mno-sse2
-DPLATFORMIO=60106
-DARDUINO_AVR_NANO
-D_WIN32
-DDEBUG_CON
-D_DEBUG_AVR
-DF_CPU=16000000L
-DARDUINO_ARCH_AVR
-DARDUINO=10808
-D__AVR_ATmega328P__
-D
-D__DBL_MIN_EXP__=(-125)
-D__HQ_FBIT__=15
-D__cpp_attributes=200809
-D__UINT_LEAST16_MAX__=0xffffU
-D__ATOMIC_ACQUIRE=2
-D__SFRACT_IBIT__=0
-D__FLT_MIN__=1.17549435e-38F
-D__GCC_IEC_559_COMPLEX=0
-D__BUILTIN_AVR_SLEEP=1
-D__BUILTIN_AVR_COUNTLSULLK=1
-D__BUILTIN_AVR_COUNTLSULLR=1
-D__UFRACT_MAX__=0XFFFFP-16UR
-D__UINT_LEAST8_TYPE__=unsigned char
-D__DQ_FBIT__=63
-D__INTMAX_C(c)=c ## LL
-D__ULFRACT_FBIT__=32
-D__SACCUM_EPSILON__=0x1P-7HK
-D__CHAR_BIT__=8
-D__USQ_IBIT__=0
-D__UINT8_MAX__=0xff
-D__ACCUM_FBIT__=15
-D__WINT_MAX__=0x7fff
-D__FLT32_MIN_EXP__=(-125)
-D__cpp_static_assert=200410
-D__USFRACT_FBIT__=8
-D__ORDER_LITTLE_ENDIAN__=1234
-D__SIZE_MAX__=0xffffU
-D__WCHAR_MAX__=0x7fff
-D__LACCUM_IBIT__=32
-D__DBL_DENORM_MIN__=double(1.40129846e-45L)
-D__GCC_ATOMIC_CHAR_LOCK_FREE=1
-D__GCC_IEC_559=0
-D__FLT_EVAL_METHOD__=0
-D__BUILTIN_AVR_LLKBITS=1
-D__cpp_binary_literals=201304
-D__LLACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-47LLK
-D__GCC_ATOMIC_CHAR32_T_LOCK_FREE=1
-D__BUILTIN_AVR_HKBITS=1
-D__BUILTIN_AVR_BITSLLK=1
-D__FRACT_FBIT__=15
-D__BUILTIN_AVR_BITSLLR=1
-D__cpp_variadic_templates=200704
-D__UINT_FAST64_MAX__=0xffffffffffffffffULL
-D__SIG_ATOMIC_TYPE__=char
-D__BUILTIN_AVR_UHKBITS=1
-D__UACCUM_FBIT__=16
-D__DBL_MIN_10_EXP__=(-37)
-D__FINITE_MATH_ONLY__=0
-D__LFRACT_IBIT__=0
-D__FLT32_HAS_DENORM__=1
-D__AVR_MEGA__=1
-D__LFRACT_MAX__=0X7FFFFFFFP-31LR
-D__UINT_FAST8_MAX__=0xff
-D__DEC64_MAX_EXP__=385
-D__INT8_C(c)=c
-D__INT_LEAST8_WIDTH__=8
-D__UINT_LEAST64_MAX__=0xffffffffffffffffULL
-D__SA_FBIT__=15
-D__SHRT_MAX__=0x7fff
-D__LDBL_MAX__=3.40282347e+38L
-D__FRACT_MAX__=0X7FFFP-15R
-D__UFRACT_FBIT__=16
-D__UFRACT_MIN__=0.0UR
-D__UINT_LEAST8_MAX__=0xff
-D__GCC_ATOMIC_BOOL_LOCK_FREE=1
-D__UINTMAX_TYPE__=long long unsigned int
-D__LLFRACT_EPSILON__=0x1P-63LLR
-D__BUILTIN_AVR_DELAY_CYCLES=1
-D__DEC32_EPSILON__=1E-6DF
-D__FLT_EVAL_METHOD_TS_18661_3__=0
-D__UINT32_MAX__=0xffffffffUL
-D__GXX_EXPERIMENTAL_CXX0X__=1
-D__ULFRACT_MAX__=0XFFFFFFFFP-32ULR
-D__TA_IBIT__=16
-D__LDBL_MAX_EXP__=128
-D__WINT_MIN__=(-__WINT_MAX__ - 1)
-D__INT_LEAST16_WIDTH__=16
-D__ULLFRACT_MIN__=0.0ULLR
-D__SCHAR_MAX__=0x7f
-D__WCHAR_MIN__=(-__WCHAR_MAX__ - 1)
-D__INT64_C(c)=c ## LL
-D__DBL_DIG__=6
-D__GCC_ATOMIC_POINTER_LOCK_FREE=1
-D__AVR_HAVE_SPH__=1
-D__LLACCUM_MIN__=(-0X1P15LLK-0X1P15LLK)
-D__BUILTIN_AVR_KBITS=1
-D__BUILTIN_AVR_ABSK=1
-D__BUILTIN_AVR_ABSR=1
-D__SIZEOF_INT__=2
-D__SIZEOF_POINTER__=2
-D__GCC_ATOMIC_CHAR16_T_LOCK_FREE=1
-D__USACCUM_IBIT__=8
-D__USER_LABEL_PREFIX__=
-D__STDC_HOSTED__=1
-D__LDBL_HAS_INFINITY__=1
-D__LFRACT_MIN__=(-0.5LR-0.5LR)
-D__HA_IBIT__=8
-D__FLT32_DIG__=6
-D__TQ_IBIT__=0
-D__FLT_EPSILON__=1.19209290e-7F
-D__GXX_WEAK__=1
-D__SHRT_WIDTH__=16
-D__USFRACT_IBIT__=0
-D__LDBL_MIN__=1.17549435e-38L
-D__FRACT_MIN__=(-0.5R-0.5R)
-D__AVR_SFR_OFFSET__=0x20
-D__DEC32_MAX__=9.999999E96DF
-D__cpp_threadsafe_static_init=200806
-D__DA_IBIT__=32
-D__INT32_MAX__=0x7fffffffL
-D__UQQ_FBIT__=8
-D__INT_WIDTH__=16
-D__SIZEOF_LONG__=4
-D__UACCUM_MAX__=0XFFFFFFFFP-16UK
-D__UINT16_C(c)=c ## U
-D__PTRDIFF_WIDTH__=16
-D__DECIMAL_DIG__=9
-D__LFRACT_EPSILON__=0x1P-31LR
-D__AVR_2_BYTE_PC__=1
-D__ULFRACT_MIN__=0.0ULR
-D__INTMAX_WIDTH__=64
-D__BUILTIN_AVR_ULLRBITS=1
-D__LDBL_HAS_QUIET_NAN__=1
-D__ULACCUM_IBIT__=32
-D__UACCUM_EPSILON__=0x1P-16UK
-D__BUILTIN_AVR_SEI=1
-D__ULLACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-48ULLK
-D__AVR_ATmega328P__=1
-D__cpp_delegating_constructors=200604
-D__HQ_IBIT__=0
-D__BUILTIN_AVR_SWAP=1
-D__FLT_HAS_DENORM__=1
-D__SIZEOF_LONG_DOUBLE__=4
-D__BIGGEST_ALIGNMENT__=1
-D__STDC_UTF_16__=1
-D__UINT24_MAX__=16777215UL
-D__BUILTIN_AVR_NOP=1
-D__GNUC_STDC_INLINE__=1
-D__DQ_IBIT__=0
-D__FLT32_HAS_INFINITY__=1
-D__DBL_MAX__=double(3.40282347e+38L)
-D__ULFRACT_IBIT__=0
-D__cpp_raw_strings=200710
-D__INT_FAST32_MAX__=0x7fffffffL
-D__DBL_HAS_INFINITY__=1
-D__INT64_MAX__=0x7fffffffffffffffLL
-D__ACCUM_IBIT__=16
-D__DEC32_MIN_EXP__=(-94)
-D__BUILTIN_AVR_UKBITS=1
-D__INTPTR_WIDTH__=16
-D__BUILTIN_AVR_FMULSU=1
-D__LACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-31LK
-D__INT_FAST16_TYPE__=int
-D__STRICT_ANSI__=1
-D__LDBL_HAS_DENORM__=1
-D__BUILTIN_AVR_BITSK=1
-D__BUILTIN_AVR_BITSR=1
-D__cplusplus=201103L
-D__cpp_ref_qualifiers=200710
-D__DEC128_MAX__=9.999999999999999999999999999999999E6144DL
-D__INT_LEAST32_MAX__=0x7fffffffL
-D__USING_SJLJ_EXCEPTIONS__=1
-D__DEC32_MIN__=1E-95DF
-D__ACCUM_MAX__=0X7FFFFFFFP-15K
-D__DEPRECATED=1
-D__cpp_rvalue_references=200610
-D__DBL_MAX_EXP__=128
-D__USACCUM_EPSILON__=0x1P-8UHK
-D__WCHAR_WIDTH__=16
-D__FLT32_MAX__=3.40282347e+38F32
-D__DEC128_EPSILON__=1E-33DL
-D__SFRACT_MAX__=0X7FP-7HR
-D__FRACT_IBIT__=0
-D__PTRDIFF_MAX__=0x7fff
-D__UACCUM_MIN__=0.0UK
-D__AVR_ENHANCED__=1
-D__UACCUM_IBIT__=16
-D__BUILTIN_AVR_NOPS=1
-D__BUILTIN_AVR_WDR=1
-D__FLT32_HAS_QUIET_NAN__=1
-D__GNUG__=7
-D__LONG_LONG_MAX__=0x7fffffffffffffffLL
-D__SIZEOF_SIZE_T__=2
-D__ULACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULK
-D__cpp_rvalue_reference=200610
-D__cpp_nsdmi=200809
-D__SIZEOF_WINT_T__=2
-D__LONG_LONG_WIDTH__=64
-D__cpp_initializer_lists=200806
-D__FLT32_MAX_EXP__=128
-D__SA_IBIT__=16
-D__ULLACCUM_MIN__=0.0ULLK
-D__BUILTIN_AVR_ROUNDUHK=1
-D__BUILTIN_AVR_ROUNDUHR=1
-D__cpp_hex_float=201603
-D__GXX_ABI_VERSION=1011
-D__INT24_MAX__=8388607L
-D__UTA_FBIT__=48
-D__FLT_MIN_EXP__=(-125)
-D__USFRACT_MAX__=0XFFP-8UHR
-D__UFRACT_IBIT__=0
-D__BUILTIN_AVR_ROUNDFX=1
-D__BUILTIN_AVR_ROUNDULK=1
-D__BUILTIN_AVR_ROUNDULR=1
-D__cpp_lambdas=200907
-D__BUILTIN_AVR_COUNTLSLLK=1
-D__BUILTIN_AVR_COUNTLSLLR=1
-D__BUILTIN_AVR_ROUNDHK=1
-D__INT_FAST64_TYPE__=long long int
-D__BUILTIN_AVR_ROUNDHR=1
-D__DBL_MIN__=double(1.17549435e-38L)
-D__BUILTIN_AVR_COUNTLSK=1
-D__BUILTIN_AVR_ROUNDLK=1
-D__BUILTIN_AVR_COUNTLSR=1
-D__BUILTIN_AVR_ROUNDLR=1
-D__LACCUM_MIN__=(-0X1P31LK-0X1P31LK)
-D__ULLACCUM_FBIT__=48
-D__BUILTIN_AVR_LKBITS=1
-D__ULLFRACT_EPSILON__=0x1P-64ULLR
-D__DEC128_MIN__=1E-6143DL
-D__REGISTER_PREFIX__=
-D__UINT16_MAX__=0xffffU
-D__DBL_HAS_DENORM__=1
-D__BUILTIN_AVR_ULKBITS=1
-D__ACCUM_MIN__=(-0X1P15K-0X1P15K)
-D__AVR_ARCH__=5
-D__SQ_IBIT__=0
-D__FLT32_MIN__=1.17549435e-38F32
-D__UINT8_TYPE__=unsigned char
-D__BUILTIN_AVR_ROUNDUK=1
-D__BUILTIN_AVR_ROUNDUR=1
-D__UHA_FBIT__=8
-D__NO_INLINE__=1
-D__SFRACT_MIN__=(-0.5HR-0.5HR)
-D__UTQ_FBIT__=128
-D__FLT_MANT_DIG__=24
-D__LDBL_DECIMAL_DIG__=9
-D__UINT64_C(c)=c ## ULL
-D__ULLFRACT_FBIT__=64
-D__cpp_unicode_characters=200704
-D__FRACT_EPSILON__=0x1P-15R
-D__ULACCUM_MIN__=0.0ULK
-D__UDA_FBIT__=32
-D__LLACCUM_EPSILON__=0x1P-47LLK
-D__GCC_ATOMIC_INT_LOCK_FREE=1
-D__FLT32_MANT_DIG__=24
-D__BUILTIN_AVR_BITSUHK=1
-D__BUILTIN_AVR_BITSUHR=1
-D__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__
-D__USFRACT_MIN__=0.0UHR
-D__BUILTIN_AVR_BITSULK=1
-D__ULLACCUM_IBIT__=16
-D__BUILTIN_AVR_BITSULR=1
-D__UQQ_IBIT__=0
-D__BUILTIN_AVR_LLRBITS=1
-D__SCHAR_WIDTH__=8
-D__BUILTIN_AVR_BITSULLK=1
-D__BUILTIN_AVR_BITSULLR=1
-D__INT32_C(c)=c ## L
-D__DEC64_EPSILON__=1E-15DD
-D__ORDER_PDP_ENDIAN__=3412
-D__DEC128_MIN_EXP__=(-6142)
-D__UHQ_FBIT__=16
-D__LLACCUM_FBIT__=47
-D__FLT32_MAX_10_EXP__=38
-D__BUILTIN_AVR_ROUNDULLK=1
-D__BUILTIN_AVR_ROUNDULLR=1
-D__INT_FAST32_TYPE__=long int
-D__BUILTIN_AVR_HRBITS=1
-D__UINT_LEAST16_TYPE__=unsigned int
-D__BUILTIN_AVR_UHRBITS=1
-D__INT16_MAX__=0x7fff
-D__SIZE_TYPE__=unsigned int
-D__UINT64_MAX__=0xffffffffffffffffULL
-D__UDQ_FBIT__=64
-D__INT8_TYPE__=signed char
-D__ELF__=1
-D__ULFRACT_EPSILON__=0x1P-32ULR
-D__LLFRACT_FBIT__=63
-D__FLT_RADIX__=2
-D__INT_LEAST16_TYPE__=int
-D__BUILTIN_AVR_ABSFX=1
-D__LDBL_EPSILON__=1.19209290e-7L
-D__UINTMAX_C(c)=c ## ULL
-D__INT24_MIN__=(-__INT24_MAX__-1)
-D__SACCUM_MAX__=0X7FFFP-7HK
-D__BUILTIN_AVR_ABSHR=1
-D__SIG_ATOMIC_MAX__=0x7f
-D__GCC_ATOMIC_WCHAR_T_LOCK_FREE=1
-D__SIZEOF_PTRDIFF_T__=2
-D__AVR=1
-D__BUILTIN_AVR_ABSLK=1
-D__BUILTIN_AVR_ABSLR=1
-D__LACCUM_EPSILON__=0x1P-31LK
-D__DEC32_SUBNORMAL_MIN__=0.000001E-95DF
-D__INT_FAST16_MAX__=0x7fff
-D__UINT_FAST32_MAX__=0xffffffffUL
-D__UINT_LEAST64_TYPE__=long long unsigned int
-D__USACCUM_MAX__=0XFFFFP-8UHK
-D__SFRACT_EPSILON__=0x1P-7HR
-D__FLT_HAS_QUIET_NAN__=1
-D__FLT_MAX_10_EXP__=38
-D__LONG_MAX__=0x7fffffffL
-D__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL
-D__FLT_HAS_INFINITY__=1
-D__cpp_unicode_literals=200710
-D__USA_FBIT__=16
-D__UINT_FAST16_TYPE__=unsigned int
-D__DEC64_MAX__=9.999999999999999E384DD
-D__INT_FAST32_WIDTH__=32
-D__BUILTIN_AVR_RBITS=1
-D__CHAR16_TYPE__=unsigned int
-D__PRAGMA_REDEFINE_EXTNAME=1
-D__AVR_HAVE_LPMX__=1
-D__SIZE_WIDTH__=16
-D__INT_LEAST16_MAX__=0x7fff
-D__DEC64_MANT_DIG__=16
-D__UINT_LEAST32_MAX__=0xffffffffUL
-D__SACCUM_FBIT__=7
-D__FLT32_DENORM_MIN__=1.40129846e-45F32
-D__GCC_ATOMIC_LONG_LOCK_FREE=1
-D__SIG_ATOMIC_WIDTH__=8
-D__INT_LEAST64_TYPE__=long long int
-D__INT16_TYPE__=int
-D__INT_LEAST8_TYPE__=signed char
-D__SQ_FBIT__=31
-D__DEC32_MAX_EXP__=97
-D__INT_FAST8_MAX__=0x7f
-D__INTPTR_MAX__=0x7fff
-D__QQ_FBIT__=7
-D__cpp_range_based_for=200907
-D__UTA_IBIT__=16
-D__FLT32_MIN_10_EXP__=(-37)
-D__LDBL_MANT_DIG__=24
-D__SFRACT_FBIT__=7
-D__SACCUM_MIN__=(-0X1P7HK-0X1P7HK)
-D__DBL_HAS_QUIET_NAN__=1
-D__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)
-D__BUILTIN_AVR_FMULS=1
-D__INTPTR_TYPE__=int
-D__UINT16_TYPE__=unsigned int
-D__WCHAR_TYPE__=int
-D__SIZEOF_FLOAT__=4
-D__AVR__=1
-D__BUILTIN_AVR_INSERT_BITS=1
-D__AVR_HAVE_JMP_CALL__=1
-D__USQ_FBIT__=32
-D__UINTPTR_MAX__=0xffffU
-D__INT_FAST64_WIDTH__=64
-D__DEC64_MIN_EXP__=(-382)
-D__cpp_decltype=200707
-D__FLT32_DECIMAL_DIG__=9
-D__INT_FAST64_MAX__=0x7fffffffffffffffLL
-D__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1
-D__FLT_DIG__=6
-D__UINT_FAST64_TYPE__=long long unsigned int
-D__BUILTIN_AVR_BITSHK=1
-D__BUILTIN_AVR_BITSHR=1
-D__INT_MAX__=0x7fff
-D__LACCUM_FBIT__=31
-D__USACCUM_MIN__=0.0UHK
-D__UHA_IBIT__=8
-D__INT64_TYPE__=long long int
-D__BUILTIN_AVR_BITSLK=1
-D__BUILTIN_AVR_BITSLR=1
-D__FLT_MAX_EXP__=128
-D__AVR_HAVE_MUL__=1
-D__UTQ_IBIT__=0
-D__DBL_MANT_DIG__=24
-D__cpp_inheriting_constructors=201511
-D__BUILTIN_AVR_ULLKBITS=1
-D__INT_LEAST64_MAX__=0x7fffffffffffffffLL
-D__AVR_HAVE_MOVW__=1
-D__DEC64_MIN__=1E-383DD
-D__WINT_TYPE__=int
-D__UINT_LEAST32_TYPE__=long unsigned int
-D__SIZEOF_SHORT__=2
-D__ULLFRACT_IBIT__=0
-D__LDBL_MIN_EXP__=(-125)
-D__UDA_IBIT__=32
-D__WINT_WIDTH__=16
-D__INT_LEAST8_MAX__=0x7f
-D__LFRACT_FBIT__=31
-D__LDBL_MAX_10_EXP__=38
-D__ATOMIC_RELAXED=0
-D__DBL_EPSILON__=double(1.19209290e-7L)
-D__BUILTIN_AVR_BITSUK=1
-D__BUILTIN_AVR_BITSUR=1
-D__UINT8_C(c)=c
-D__INT_LEAST32_TYPE__=long int
-D__BUILTIN_AVR_URBITS=1
-D__SIZEOF_WCHAR_T__=2
-D__LLFRACT_MAX__=0X7FFFFFFFFFFFFFFFP-63LLR
-D__TQ_FBIT__=127
-D__INT_FAST8_TYPE__=signed char
-D__ULLACCUM_EPSILON__=0x1P-48ULLK
-D__BUILTIN_AVR_ROUNDK=1
-D__BUILTIN_AVR_ROUNDR=1
-D__UHQ_IBIT__=0
-D__LLACCUM_IBIT__=16
-D__FLT32_EPSILON__=1.19209290e-7F32
-D__AVR_DEVICE_NAME__=atmega328p
-D__DBL_DECIMAL_DIG__=9
-D__STDC_UTF_32__=1
-D__INT_FAST8_WIDTH__=8
-D__DEC_EVAL_METHOD__=2
-D__TA_FBIT__=47
-D__UDQ_IBIT__=0
-D__ORDER_BIG_ENDIAN__=4321
-D__cpp_runtime_arrays=198712
-D__WITH_AVRLIBC__=1
-D__UINT64_TYPE__=long long unsigned int
-D__ACCUM_EPSILON__=0x1P-15K
-D__UINT32_C(c)=c ## UL
-D__BUILTIN_AVR_COUNTLSUHK=1
-D__INTMAX_MAX__=0x7fffffffffffffffLL
-D__cpp_alias_templates=200704
-D__BUILTIN_AVR_COUNTLSUHR=1
-D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__
-D__FLT_DENORM_MIN__=1.40129846e-45F
-D__LLFRACT_IBIT__=0
-D__INT8_MAX__=0x7f
-D__LONG_WIDTH__=32
-D__UINT_FAST32_TYPE__=long unsigned int
-D__CHAR32_TYPE__=long unsigned int
-D__BUILTIN_AVR_COUNTLSULK=1
-D__BUILTIN_AVR_COUNTLSULR=1
-D__FLT_MAX__=3.40282347e+38F
-D__cpp_constexpr=200704
-D__USACCUM_FBIT__=8
-D__BUILTIN_AVR_COUNTLSFX=1
-D__INT32_TYPE__=long int
-D__SIZEOF_DOUBLE__=4
-D__FLT_MIN_10_EXP__=(-37)
-D__UFRACT_EPSILON__=0x1P-16UR
-D__INT_LEAST32_WIDTH__=32
-D__BUILTIN_AVR_COUNTLSHK=1
-D__BUILTIN_AVR_COUNTLSHR=1
-D__INTMAX_TYPE__=long long int
-D__BUILTIN_AVR_ABSLLK=1
-D__BUILTIN_AVR_ABSLLR=1
-D__DEC128_MAX_EXP__=6145
-D__AVR_HAVE_16BIT_SP__=1
-D__ATOMIC_CONSUME=1
-D__INT_FAST16_WIDTH__=16
-D__UINTMAX_MAX__=0xffffffffffffffffULL
-D__DEC32_MANT_DIG__=7
-D__HA_FBIT__=7
-D__BUILTIN_AVR_COUNTLSLK=1
-D__BUILTIN_AVR_COUNTLSLR=1
-D__BUILTIN_AVR_CLI=1
-D__DBL_MAX_10_EXP__=38
-D__LDBL_DENORM_MIN__=1.40129846e-45L
-D__INT16_C(c)=c
-D__STDC__=1
-D__PTRDIFF_TYPE__=int
-D__LLFRACT_MIN__=(-0.5LLR-0.5LLR)
-D__BUILTIN_AVR_LRBITS=1
-D__ATOMIC_SEQ_CST=5
-D__DA_FBIT__=31
-D__UINT32_TYPE__=long unsigned int
-D__BUILTIN_AVR_ROUNDLLK=1
-D__UINTPTR_TYPE__=unsigned int
-D__BUILTIN_AVR_ROUNDLLR=1
-D__USA_IBIT__=16
-D__BUILTIN_AVR_ULRBITS=1
-D__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD
-D__DEC128_MANT_DIG__=34
-D__LDBL_MIN_10_EXP__=(-37)
-D__BUILTIN_AVR_COUNTLSUK=1
-D__BUILTIN_AVR_COUNTLSUR=1
-D__SIZEOF_LONG_LONG__=8
-D__ULACCUM_EPSILON__=0x1P-32ULK
-D__cpp_user_defined_literals=200809
-D__SACCUM_IBIT__=8
-D__GCC_ATOMIC_LLONG_LOCK_FREE=1
-D__LDBL_DIG__=6
-D__FLT_DECIMAL_DIG__=9
-D__UINT_FAST16_MAX__=0xffffU
-D__GCC_ATOMIC_SHORT_LOCK_FREE=1
-D__BUILTIN_AVR_ABSHK=1
-D__BUILTIN_AVR_FLASH_SEGMENT=1
-D__INT_LEAST64_WIDTH__=64
-D__ULLFRACT_MAX__=0XFFFFFFFFFFFFFFFFP-64ULLR
-D__UINT_FAST8_TYPE__=unsigned char
-D__USFRACT_EPSILON__=0x1P-8UHR
-D__ULACCUM_FBIT__=32
-D__QQ_IBIT__=0
-D__ATOMIC_ACQ_REL=4
-D__ATOMIC_RELEASE=3
-D__BUILTIN_AVR_FMUL=1
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/include
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/src
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/ClockController
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/zmanim
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/RTCLibWrapper
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/DisplayWrapper
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/Utils
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Noiasca Liquid Crystal
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Noiasca Liquid Crystal/utility
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/avr-debugger/avr8-stub
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/StateMachine/src
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/LinkedList
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/OneButton/src
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/RTClib/src
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Adafruit BusIO
-IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SPI/src
-IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/Wire/src
-IC:/Users/User/.platformio/packages/framework-arduino-avr/cores/arduino
-IC:/Users/User/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs
-IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src
-IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/HID/src
-IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src
-isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include
-isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include-fixed
-isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/avr/include
cpptools/fileChanged: C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp
Error while processing C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp.
warning: redefining builtin macro [clang-diagnostic-builtin-macro-redefined]
error: macro name must be an identifier [clang-diagnostic-error]
C:/Users/User/.platformio/packages/toolchain-atmelavr/avr/include\util/delay_basic.h:108:5: error: invalid output constraint '=w' in asm [clang-diagnostic-error]
: "=w" (__count)
^
C:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include\stddef.h:216:23: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long long') [clang-diagnostic-error]
typedef __SIZE_TYPE__ size_t;
^
C:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/ClockController\ClockController.h:145:14: error: variable-sized object may not be initialized [clang-diagnostic-error]
char yom_tov_name[yom_tov_name_size] = "";
^ ~~
C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp:187:4: warning: 'sprintf' will always overflow; destination buffer has size 2, but format string expands to at least 7 [clang-diagnostic-fortify-source]
sprintf(cc,"%s hello",cc);
^
idle loop: reparsing the active document
Checking for syntax errors: C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp
Queueing IntelliSense update for files in translation unit of: C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp
cpptools/finishUpdateSquiggles
Error squiggle count: 0
Update IntelliSense time (sec): 0.257
cpptools/getSemanticTokens: C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp (id: 407)
cpptools/getFoldingRanges: C:\Users\User\Documents\PlatformIO\Projects\JewishClock\HClock\src\main-master.cpp (id: 408)
Other Extensions
No response
Additional context
No response
@emaayan
Just to confirm, have you tried setting C_Cpp.codeAnalysis.clangTidy.headerFilter to only include files in the workspace? Do you have any other folder settings configured that could be related to code analysis or folder/file filtering such as C_Cpp.codeAnalysis.exclude?


i have tried both include header files and exclude directories, `"settings": { "java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "C:/Dev/Java/jdk1.8.0_211/",
}
],
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
"C_Cpp.codeAnalysis.exclude": {
"**/C:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SPI/src":true,
"**/.pio":true
},
"C_Cpp.codeAnalysis.runAutomatically": true,
"C_Cpp.codeAnalysis.clangTidy.headerFilter": "${workspaceFolder}/**",
"C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": false,
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"vector": "cpp",
"functional": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"string_view": "cpp",
"type_traits": "cpp",
"random": "cpp",
"initializer_list": "cpp",
"istream": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"typeinfo": "cpp"
},
"C_Cpp.codeAnalysis.clangTidy.args": [
"--extra-arg=-nostdinc",
"--extra-arg=-nostdinc++"
]
}`
infact i even tried excluding EVERYTHING from the workspace folder, yet it seems to have no effect on the include library.
`"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "C:/Dev/Java/jdk1.8.0_211/",
}
],
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
"C_Cpp.codeAnalysis.exclude": {
"**/C:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SPI/src":true,
"**/.pio":true,
"${workspaceFolder}/**":true
},
"C_Cpp.codeAnalysis.runAutomatically": true,
"C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": false,
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"vector": "cpp",
"functional": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"string_view": "cpp",
"type_traits": "cpp",
"random": "cpp",
"initializer_list": "cpp",
"istream": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"typeinfo": "cpp"
},
"C_Cpp.codeAnalysis.clangTidy.args": [
"--extra-arg=-nostdinc",
"--extra-arg=-nostdinc++"
]
`
-IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/include -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/src -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/ClockController -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/zmanim -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/RTCLibWrapper -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/DisplayWrapper -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/lib/Utils -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Noiasca Liquid Crystal -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Noiasca Liquid Crystal/utility -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/avr-debugger/avr8-stub -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/StateMachine/src -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/LinkedList -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/OneButton/src -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/RTClib/src -IC:/Users/User/Documents/PlatformIO/Projects/JewishClock/HClock/.pio/libdeps/master/Adafruit BusIO -IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SPI/src -IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/Wire/src -IC:/Users/User/.platformio/packages/framework-arduino-avr/cores/arduino -IC:/Users/User/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs -IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src -IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/HID/src -IC:/Users/User/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include-fixed -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/avr/include
the primary issue is that system liberaries are kept beign included, and those are the ones the produce the errors i've tried various switches to exclude them but that doesn't seem to be supported in the clang-tidy that comes with vscode. -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/7.3.0/include-fixed -isystemC:/Users/User/.platformio/packages/toolchain-atmelavr/avr/include
note the error seem to be a compile error, but my project actually compiles ok.
C:/Users/User/.platformio/packages/toolchain-atmelavr/avr/include\util/delay_basic.h:108:5: error: invalid output constraint '=w' in asm [clang-diagnostic-error] : "=w" (__count) ^
I was able to repro with just installed PlatformIO and creating a sample project. For some reason the system include paths are getting included by clang-tidy.
We still need further investigation whether this is caused by the args passed by the extension to clang-tidy or if clang-tidy has a bug with filtering.
excellent, in the meantime i've switched to using https://marketplace.visualstudio.com/items?itemName=jbenden.c-cpp-flylint which just needs cppcheck (or any other linter) it was very easy to configure with cppcheck(despite the comments), which doesn't seem to suffer the same problem.
a few notes though, here a few posts about specifically the error i've been getting: https://community.platformio.org/t/error-asm-invalid-output-constraint-with-clang/10577 this suggest that changing platfrom.io's platfrom.ini effects the include paths.
this is on SO https://stackoverflow.com/questions/20264680/clang-avr-compilation-error-w-in-asm suggest this is a compiler error, i'm not exactly sure how clang-tidy works and if it's actually compling the code as well.
also note that there's a difference between a compile error and just a warning, i seem to be getting compile errors, however the project actually compiles ok, https://github.com/clangd/clangd/issues/776
you can tell clang-tidy to ignore system headers https://github.com/microsoft/vscode-cpptools/issues/8740#issuecomment-1024941583, how this will cause other compile errors becuase standard headers will also not be found. check with @sean-mcmanus may have insight..
lastly platfromio also has support for static analsys but it seems to be geared towards CI rather then immdidate feedback like cpptools has which vastly more helpfull i think it also uses cppcheck by default but it can use clang-tidy https://docs.platformio.org/en/latest/core/userguide/cmd_check.html
@emaayan
Thanks for the additional insight, this will help with the investigation. The --header-filter in the logs is set to filter the workspace folder, so it's strange why clang-tidy is not filtering.
I've assigned this to @sean-mcmanus to investigate. He also did the integration of Clang-Tidy.
@emaayan Thanks for the additional insight, this will help with the investigation. The
--header-filterin the logs is set to filter the workspace folder, so it's strange why clang-tidy is not filtering.I've assigned this to @sean-mcmanus to investigate. He also did the integration of Clang-Tidy.
probably because those are compile errors and as said but 776, there's no way to supress compile errors in system headers, so the bigger question is how can clang-tidy be configured correclty so it would compile avr.
You could try generating a compile_commands.json (and setting the compileCommands property) and setting C_Cpp.codeAnalysis.clangTidy.useBuildPath to true. But using cppcheck might be better. I'm not sure if clang is capable of compiling that platform IO code.
I went down the path of having platformio generate the latest compile_commands.json (see https://docs.platformio.org/en/latest/integration/compile_commands.html for how you can have it include the toolchain paths, which are omitted by default!) after a successful build and then had clang-tiny use this file (either via the -p switch and pointing to the directory that the compile_commands.json is in or by just letting it find it when the file is at the project root), but clang doesn't seem to be able to build the arduino framework code, unlike how platform IO itself is able to.
When you run pio check and your platformio.ini is setup to use clang-tiny, platform IO uses a specific version of clang-tiny.
check_tool = clangtidy
check_flags =
clangtidy: --config-file=.clang-tidy
/Users/xxxx/.platformio/packages/tool-clangtidy/package.json
{
"name": "tool-clangtidy",
"version": "1.150005.0",
"description": "clang-tidy is a clang-based C++ linter tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis",
"keywords": [
"static analysis",
"tools"
],
"homepage": "https://clang.llvm.org/extra/clang-tidy/",
"license": "Apache-2.0",
"system": [
"darwin_x86_64",
"darwin_arm64"
],
"repository": {
"type": "git",
"url": "https://github.com/llvm/llvm-project"
}
}
When running clang-tidy manually on a single file using the logs that pio check generates, I noticed the following errors:
error: unknown argument '-mlongcalls'; did you mean '-mlong-calls'? [clang-diagnostic-error]
error: unknown argument: '-fno-tree-switch-conversion' [clang-diagnostic-error]
error: unknown argument: '-fstrict-volatile-bitfields' [clang-diagnostic-error]
error: unknown argument: '-mfix-esp32-psram-cache-issue' [clang-diagnostic-error]
error: unknown argument: '-mfix-esp32-psram-cache-strategy=memw' [clang-diagnostic-error]
error: optimization flag '-freorder-blocks' is not supported [clang-diagnostic-ignored-optimization-argument]
In my latest compile_commands.json, you'll see a reference to one of the above arguments clang-tidy is complaining about:
"command": "/Users/xxxx/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++ -o .pio/build/xxxx/FrameworkArduino/FirmwareMSC.cpp.o -c -Wno-frame-address -std=gnu++11 -fexceptions -fno-rtti -mfix-esp32-psram-cache-strategy=memw -Werror -Wno-unused-variable -Wno-comment -Wno-unused-but-set-variable -Wno-switch -Wno-deprecated-declarations -Wno-unused-function -Wno-builtin-macro-redefined -Wreturn-type -mfix-esp32-psram-cache-issue -mlongcalls ... (the rest omitted for brevity)
I believe this and other errors seen generated by clang-tidy is the root cause of the problem:
/Users/xxxx/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/freertos/include/freertos/task.h:442:19: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma [clang-diagnostic-error]
static inline IRAM_ATTR BaseType_t xTaskCreate(
When clang-tiny is run, it seems to be ignoring the target and is instead (possibly) trying to build for arm64.
Obviously this code builds when using platformio's tools (which uses xtensa-esp32-elf-g++). But somehow clang-tiny isn't able to, even if using a compile_commands.json generated by platformio.
Ultimately clang-tidy is designed to be used with clang (obviously) and not some other compiler (like xtensa-esp32-elf-g++).
As an update, this still occurs today.
Still occurs today indeed.