Всем привет! Решил познакомиться с CLang, IDE Qt Creator, проект на Pure C, собираю через CMake, акромя добавления файлов есть это:
cmake_minimum_required(VERSION 3.5)
project(mqttc C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_FLAGS "")
set(CMAKE_COLOR_MAKEFILE ON)
Тыкаю в IDE на меню Анализ => Статический анализатор Clang и получаю портянку
:-1: предупреждение: Командная строка: «/usr/bin/clang" "--analyze" "-o" "/tmp/qtc-clangstaticanalyzer-N3jIiq/report-main.c-Di2977.plist" "-m64" "-target" "x86_64-unknown-linux-gnu" "-x" "c" "-std=gnu++11" "-fcxx-exceptions" "-fexceptions" "-D_GNU_SOURCE=1" "-D_LP64=1" "-D__ATOMIC_ACQUIRE=2" "-D__ATOMIC_ACQ_REL=4" "-D__ATOMIC_CONSUME=1" "-D__ATOMIC_RELAXED=0" "-D__ATOMIC_RELEASE=3" "-D__ATOMIC_SEQ_CST=5" "-D__BIGGEST_ALIGNMENT__=16" "-D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__" "-D__CHAR16_TYPE__=unsigned short" "-D__CHAR32_TYPE__=unsigned int" "-D__CHAR_BIT__=8" "-D__CONSTANT_CFSTRINGS__=1" "-D__DBL_DECIMAL_DIG__=17" "-D__DBL_DENORM_MIN__=4.9406564584124654e-324" "-D__DBL_DIG__=15" "-D__DBL_EPSILON__=2.2204460492503131e-16" "-D__DBL_HAS_DENORM__=1" "-D__DBL_HAS_INFINITY__=1" "-D__DBL_HAS_QUIET_NAN__=1" "-D__DBL_MANT_DIG__=53" "-D__DBL_MAX_10_EXP__=308" "-D__DBL_MAX_EXP__=1024" "-D__DBL_MAX__=1.7976931348623157e+308" "-D__DBL_MIN_10_EXP__=(-307)" "-D__DBL_MIN_EXP__=(-1021)" "-D__DBL_MIN__=2.2250738585072014e-308" "-D__DECIMAL_DIG__=__LDBL_DECIMAL_DIG__" "-D__DEPRECATED=1" "-D__ELF__=1" "-D__EXCEPTIONS=1" "-D__FINITE_MATH_ONLY__=0" "-D__FLT_DECIMAL_DIG__=9" "-D__FLT_DENORM_MIN__=1.40129846e-45F" "-D__FLT_DIG__=6" "-D__FLT_EPSILON__=1.19209290e-7F" "-D__FLT_EVAL_METHOD__=0" "-D__FLT_HAS_DENORM__=1" "-D__FLT_HAS_INFINITY__=1" "-D__FLT_HAS_QUIET_NAN__=1" "-D__FLT_MANT_DIG__=24" "-D__FLT_MAX_10_EXP__=38" "-D__FLT_MAX_EXP__=128" "-D__FLT_MAX__=3.40282347e+38F" "-D__FLT_MIN_10_EXP__=(-37)" "-D__FLT_MIN_EXP__=(-125)" "-D__FLT_MIN__=1.17549435e-38F" "-D__FLT_RADIX__=2" "-D__FXSR__=1" "-D__GCC_ATOMIC_BOOL_LOCK_FREE=2" "-D__GCC_ATOMIC_CHAR16_T_LOCK_FREE=2" "-D__GCC_ATOMIC_CHAR32_T_LOCK_FREE=2" "-D__GCC_ATOMIC_CHAR_LOCK_FREE=2" "-D__GCC_ATOMIC_INT_LOCK_FREE=2" "-D__GCC_ATOMIC_LLONG_LOCK_FREE=2" "-D__GCC_ATOMIC_LONG_LOCK_FREE=2" "-D__GCC_ATOMIC_POINTER_LOCK_FREE=2" "-D__GCC_ATOMIC_SHORT_LOCK_FREE=2" "-D__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1" "-D__GCC_ATOMIC_WCHAR_T_LOCK_FREE=2" "-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__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1" "-D__GNUC_GNU_INLINE__=1" "-D__GNUC_MINOR__=2" "-D__GNUC_PATCHLEVEL__=1" "-D__GNUC__=4" "-D__GNUG__=4" "-D__GXX_ABI_VERSION=1002" "-D__GXX_RTTI=1" "-D__GXX_WEAK__=1" "-D__INT16_C_SUFFIX__=" "-D__INT16_FMTd__="hd"" "-D__INT16_FMTi__="hi"" "-D__INT16_MAX__=32767" "-D__INT16_TYPE__=short" "-D__INT32_C_SUFFIX__=" "-D__INT32_FMTd__="d"" "-D__INT32_FMTi__="i"" "-D__INT32_MAX__=2147483647" "-D__INT32_TYPE__=int" "-D__INT64_C_SUFFIX__=L" "-D__INT64_FMTd__="ld"" "-D__INT64_FMTi__="li"" "-D__INT64_MAX__=9223372036854775807L" "-D__INT64_TYPE__=long int" "-D__INT8_C_SUFFIX__=" "-D__INT8_FMTd__="hhd"" "-D__INT8_FMTi__="hhi"" "-D__INT8_MAX__=127" "-D__INT8_TYPE__=signed char" "-D__INTMAX_C_SUFFIX__=L" "-D__INTMAX_FMTd__="ld"" "-D__INTMAX_FMTi__="li"" "-D__INTMAX_MAX__=9223372036854775807L" "-D__INTMAX_TYPE__=long int" "-D__INTMAX_WIDTH__=64" "-D__INTPTR_FMTd__="ld"" "-D__INTPTR_FMTi__="li"" "-D__INTPTR_MAX__=9223372036854775807L" "-D__INTPTR_TYPE__=long int" "-D__INTPTR_WIDTH__=64" "-D__INT_FAST16_FMTd__="hd"" "-D__INT_FAST16_FMTi__="hi"" "-D__INT_FAST16_MAX__=32767" "-D__INT_FAST16_TYPE__=short" "-D__INT_FAST32_FMTd__="d"" "-D__INT_FAST32_FMTi__="i"" "-D__INT_FAST32_MAX__=2147483647" "-D__INT_FAST32_TYPE__=int" "-D__INT_FAST64_FMTd__="ld"" "-D__INT_FAST64_FMTi__="li"" "-D__INT_FAST64_MAX__=9223372036854775807L" "-D__INT_FAST64_TYPE__=long int" "-D__INT_FAST8_FMTd__="hhd"" "-D__INT_FAST8_FMTi__="hhi"" "-D__INT_FAST8_MAX__=127" "-D__INT_FAST8_TYPE__=signed char" "-D__INT_LEAST16_FMTd__="hd"" "-D__INT_LEAST16_FMTi__="hi"" "-D__INT_LEAST16_MAX__=32767" "-D__INT_LEAST16_TYPE__=short" "-D__INT_LEAST32_FMTd__="d"" "-D__INT_LEAST32_FMTi__="i"" "-D__INT_LEAST32_MAX__=2147483647" "-D__INT_LEAST32_TYPE__=int" "-D__INT_LEAST64_FMTd__="ld"" "-D__INT_LEAST64_FMTi__="li"" "-D__INT_LEAST64_MAX__=9223372036854775807L" "-D__INT_LEAST64_TYPE__=long int" "-D__INT_LEAST8_FMTd__="hhd"" "-D__INT_LEAST8_FMTi__="hhi"" "-D__INT_LEAST8_MAX__=127" "-D__INT_LEAST8_TYPE__=signed char" "-D__INT_MAX__=2147483647" "-D__LDBL_DECIMAL_DIG__=21" "-D__LDBL_DENORM_MIN__=3.64519953188247460253e-4951L" "-D__LDBL_DIG__=18" "-D__LDBL_EPSILON__=1.08420217248550443401e-19L" "-D__LDBL_HAS_DENORM__=1" "-D__LDBL_HAS_INFINITY__=1" "-D__LDBL_HAS_QUIET_NAN__=1" "-D__LDBL_MANT_DIG__=64" "-D__LDBL_MAX_10_EXP__=4932" "-D__LDBL_MAX_EXP__=16384" "-D__LDBL_MAX__=1.18973149535723176502e+4932L" "-D__LDBL_MIN_10_EXP__=(-4931)" "-D__LDBL_MIN_EXP__=(-16381)" "-D__LDBL_MIN__=3.36210314311209350626e-4932L" "-D__LITTLE_ENDIAN__=1" "-D__LONG_LONG_MAX__=9223372036854775807LL" "-D__LONG_MAX__=9223372036854775807L" "-D__LP64__=1" "-D__MMX__=1" "-D__NO_INLINE__=1" "-D__NO_MATH_INLINES=1" "-D__ORDER_BIG_ENDIAN__=4321" "-D__ORDER_LITTLE_ENDIAN__=1234" "-D__ORDER_PDP_ENDIAN__=3412" "-D__POINTER_WIDTH__=64" "-D__PRAGMA_REDEFINE_EXTNAME=1" "-D__PTRDIFF_FMTd__="ld"" "-D__PTRDIFF_FMTi__="li"" "-D__PTRDIFF_MAX__=9223372036854775807L" "-D__PTRDIFF_TYPE__=long int" "-D__PTRDIFF_WIDTH__=64" "-D__REGISTER_PREFIX__=" "-D__SCHAR_MAX__=127" "-D__SHRT_MAX__=32767" "-D__SIG_ATOMIC_MAX__=2147483647" "-D__SIG_ATOMIC_WIDTH__=32" "-D__SIZEOF_DOUBLE__=8" "-D__SIZEOF_FLOAT__=4" "-D__SIZEOF_INT128__=16" "-D__SIZEOF_INT__=4" "-D__SIZEOF_LONG_DOUBLE__=16" "-D__SIZEOF_LONG_LONG__=8" "-D__SIZEOF_LONG__=8" "-D__SIZEOF_POINTER__=8" "-D__SIZEOF_PTRDIFF_T__=8" "-D__SIZEOF_SHORT__=2" "-D__SIZEOF_SIZE_T__=8" "-D__SIZEOF_WCHAR_T__=4" "-D__SIZEOF_WINT_T__=4" "-D__SIZE_FMTX__="lX"" "-D__SIZE_FMTo__="lo"" "-D__SIZE_FMTu__="lu"" "-D__SIZE_FMTx__="lx"" "-D__SIZE_MAX__=18446744073709551615UL" "-D__SIZE_TYPE__=long unsigned int" "-D__SIZE_WIDTH__=64" "-D__SSE2_MATH__=1" "-D__SSE2__=1" "-D__SSE_MATH__=1" "-D__SSE__=1" "-D__STDC_HOSTED__=1" "-D__STDC_UTF_16__=1" "-D__STDC_UTF_32__=1" "-D__STDC__=1" "-D__UINT16_C_SUFFIX__=" "-D__UINT16_FMTX__="hX"" "-D__UINT16_FMTo__="ho"" "-D__UINT16_FMTu__="hu"" "-D__UINT16_FMTx__="hx"" "-D__UINT16_MAX__=65535" "-D__UINT16_TYPE__=unsigned short" "-D__UINT32_C_SUFFIX__=U" "-D__UINT32_FMTX__="X"" "-D__UINT32_FMTo__="o"" "-D__UINT32_FMTu__="u"" "-D__UINT32_FMTx__="x"" "-D__UINT32_MAX__=4294967295U" "-D__UINT32_TYPE__=unsigned int" "-D__UINT64_C_SUFFIX__=UL" "-D__UINT64_FMTX__="lX"" "-D__UINT64_FMTo__="lo"" "-D__UINT64_FMTu__="lu"" "-D__UINT64_FMTx__="lx"" "-D__UINT64_MAX__=18446744073709551615UL" "-D__UINT64_TYPE__=long unsigned int" "-D__UINT8_C_SUFFIX__=" "-D__UINT8_FMTX__="hhX"" "-D__UINT8_FMTo__="hho"" "-D__UINT8_FMTu__="hhu"" "-D__UINT8_FMTx__="hhx"" "-D__UINT8_MAX__=255" "-D__UINT8_TYPE__=unsigned char" "-D__UINTMAX_C_SUFFIX__=UL" "-D__UINTMAX_FMTX__="lX"" "-D__UINTMAX_FMTo__="lo"" "-D__UINTMAX_FMTu__="lu"" "-D__UINTMAX_FMTx__="lx"" "-D__UINTMAX_MAX__=18446744073709551615UL" "-D__UINTMAX_TYPE__=long unsigned int" "-D__UINTMAX_WIDTH__=64" "-D__UINTPTR_FMTX__="lX"" "-D__UINTPTR_FMTo__="lo"" "-D__UINTPTR_FMTu__="lu"" "-D__UINTPTR_FMTx__="lx"" "-D__UINTPTR_MAX__=18446744073709551615UL" "-D__UINTPTR_TYPE__=long unsigned int" "-D__UINTPTR_WIDTH__=64" "-D__UINT_FAST16_FMTX__="hX"" "-D__UINT_FAST16_FMTo__="ho"" "-D__UINT_FAST16_FMTu__="hu"" "-D__UINT_FAST16_FMTx__="hx"" "-D__UINT_FAST16_MAX__=65535" "-D__UINT_FAST16_TYPE__=unsigned short" "-D__UINT_FAST32_FMTX__="X"" "-D__UINT_FAST32_FMTo__="o"" "-D__UINT_FAST32_FMTu__="u"" "-D__UINT_FAST32_FMTx__="x"" "-D__UINT_FAST32_MAX__=4294967295U" "-D__UINT_FAST32_TYPE__=unsigned int" "-D__UINT_FAST64_FMTX__="lX"" "-D__UINT_FAST64_FMTo__="lo"" "-D__UINT_FAST64_FMTu__="lu"" "-D__UINT_FAST64_FMTx__="lx"" "-D__UINT_FAST64_MAX__=18446744073709551615UL" "-D__UINT_FAST64_TYPE__=long unsigned int" "-D__UINT_FAST8_FMTX__="hhX"" "-D__UINT_FAST8_FMTo__="hho"" "-D__UINT_FAST8_FMTu__="hhu"" "-D__UINT_FAST8_FMTx__="hhx"" "-D__UINT_FAST8_MAX__=255" "-D__UINT_FAST8_TYPE__=unsigned char" "-D__UINT_LEAST16_FMTX__="hX"" "-D__UINT_LEAST16_FMTo__="ho"" "-D__UINT_LEAST16_FMTu__="hu"" "-D__UINT_LEAST16_FMTx__="hx"" "-D__UINT_LEAST16_MAX__=65535" "-D__UINT_LEAST16_TYPE__=unsigned short" "-D__UINT_LEAST32_FMTX__="X"" "-D__UINT_LEAST32_FMTo__="o"" "-D__UINT_LEAST32_FMTu__="u"" "-D__UINT_LEAST32_FMTx__="x"" "-D__UINT_LEAST32_MAX__=4294967295U" "-D__UINT_LEAST32_TYPE__=unsigned int" "-D__UINT_LEAST64_FMTX__="lX"" "-D__UINT_LEAST64_FMTo__="lo"" "-D__UINT_LEAST64_FMTu__="lu"" "-D__UINT_LEAST64_FMTx__="lx"" "-D__UINT_LEAST64_MAX__=18446744073709551615UL" "-D__UINT_LEAST64_TYPE__=long unsigned int" "-D__UINT_LEAST8_FMTX__="hhX"" "-D__UINT_LEAST8_FMTo__="hho"" "-D__UINT_LEAST8_FMTu__="hhu"" "-D__UINT_LEAST8_FMTx__="hhx"" "-D__UINT_LEAST8_MAX__=255" "-D__UINT_LEAST8_TYPE__=unsigned char" "-D__USER_LABEL_PREFIX__=" "-D__VERSION__="4.2.1 Compatible Clang 3.8.0 (tags/RELEASE_380/final 262553)"" "-D__WCHAR_MAX__=2147483647" "-D__WCHAR_TYPE__=int" "-D__WCHAR_WIDTH__=32" "-D__WINT_TYPE__=unsigned int" "-D__WINT_UNSIGNED__=1" "-D__WINT_WIDTH__=32" "-D__amd64=1" "-D__amd64__=1" "-D__clang__=1" "-D__clang_major__=3" "-D__clang_minor__=8" "-D__clang_patchlevel__=0" "-D__clang_version__="3.8.0 (tags/RELEASE_380/final 262553)"" "-D__cpp_exceptions=199711" "-D__cpp_rtti=199711" "-D__gnu_linux__=1" "-D__k8=1" "-D__k8__=1" "-D__linux=1" "-D__linux__=1" "-D__llvm__=1" "-D__private_extern__=extern" "-D__tune_k8__=1" "-D__unix=1" "-D__unix__=1" "-D__x86_64=1" "-D__x86_64__=1" "-Dlinux=1" "-Dunix=1" "-DWITH_TLS=" "-DWITH_SOCKS=" "-I/usr/include" "-I/usr/include/at-spi-2.0" "-I/usr/include/at-spi2-atk/2.0" "-I/usr/include/atk-1.0" "-I/usr/include/cairo" "-I/usr/include/dbus-1.0" "-I/usr/include/freetype2" "-I/usr/include/gdk-pixbuf-2.0" "-I/usr/include/gio-unix-2.0" "-I/usr/include/glib-2.0" "-I/usr/include/gtk-3.0" "-I/usr/include/harfbuzz" "-I/usr/include/libdrm" "-I/usr/include/libpng16" "-I/usr/include/pango-1.0" "-I/usr/include/pixman-1" "-I/usr/lib64/dbus-1.0/include" "-I/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/include" "-I/usr/lib64/gcc/x86_64-suse-linux/4.8/include" "-I/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed" "-I/usr/lib64/glib-2.0/include" "-I/usr/local/include" "-I/home/user/mqtt" "-I/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8" "-I/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8/x86_64-suse-linux" "-I/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8/backward" "-I/usr/bin/../lib64/clang/3.8.0/include" "-fPIC" "/home/user/mqtt/main.c»
Ошибка: 5
Вывод:
clang-3.8: warning: argument unused during compilation: '-fcxx-exceptions'
error: invalid argument '-std=gnu++11' not allowed with 'C/ObjC'
:-1: ошибка: Статический анализатор Clang: Не все файлы удалось проанализовать.
Собс-но как убрать -std=gnu++11? И собс-но ЧЯДНТ?