Every time I run code analysis in C++ project I receive __float128 is not supported on this target
Is any possibility to turn off those kind of clang errors?
I have been searching answer for hours, but could not find anything.
My setup: Visual Studio Code V1.70.0, cmake, GCC v11.3.0., clang built with VSC, C++20
The whole error:
[{
"resource": "/d:/OneDrive/Documents/Programming languages/c++/Projects/firstProject/main.cpp",
"owner": "clang-tidy",
"code": "clang-diagnostic-error",
"severity": 8,
"message": "Error while processing",
"source": "C/C++",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 2,
"relatedInformation": [
{
"startLineNumber": 101,
"startColumn": 3,
"endLineNumber": 101,
"endColumn": 13,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/bits/std_abs.h"
},
{
"startLineNumber": 102,
"startColumn": 7,
"endLineNumber": 102,
"endColumn": 17,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/bits/std_abs.h"
},
{
"startLineNumber": 1049,
"startColumn": 21,
"endLineNumber": 1049,
"endColumn": 31,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/bits/stl_algobase.h"
},
{
"startLineNumber": 138,
"startColumn": 22,
"endLineNumber": 138,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 138,
"startColumn": 37,
"endLineNumber": 138,
"endColumn": 47,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 143,
"startColumn": 22,
"endLineNumber": 143,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 143,
"startColumn": 41,
"endLineNumber": 143,
"endColumn": 51,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 148,
"startColumn": 22,
"endLineNumber": 148,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 148,
"startColumn": 42,
"endLineNumber": 148,
"endColumn": 52,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 153,
"startColumn": 22,
"endLineNumber": 153,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 153,
"startColumn": 38,
"endLineNumber": 153,
"endColumn": 48,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 158,
"startColumn": 22,
"endLineNumber": 158,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 158,
"startColumn": 42,
"endLineNumber": 158,
"endColumn": 52,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 163,
"startColumn": 22,
"endLineNumber": 163,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 163,
"startColumn": 46,
"endLineNumber": 163,
"endColumn": 56,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 168,
"startColumn": 22,
"endLineNumber": 168,
"endColumn": 32,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 168,
"startColumn": 39,
"endLineNumber": 168,
"endColumn": 49,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 173,
"startColumn": 40,
"endLineNumber": 173,
"endColumn": 50,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/numbers"
},
{
"startLineNumber": 415,
"startColumn": 39,
"endLineNumber": 415,
"endColumn": 49,
"message": "__float128 is not supported on this target",
"resource": "/C:/msys64/mingw64/include/c++/11.3.0/type_traits"
}
]
}]
2
Answers
I’been encounting with the same situation. But in my case gnu g++, mingw , C++11 or 17. I’been searching answer for 2 days, but couldn’t find. Originally, that error is generated from a fact that __float128 is not declared’ within ‘std_abs.h’ header file. I solved this problem by adding one line at starting point of main.cpp, like this
#define __STRICT_ANSI__
because if__STRICT_ANSI__
is not defined, some code related with __float128 will activate.I hope this answer will be helpful though my poor English skills. Thanks
This problem may be caused by your VSCode using clang-tidy as the C/C++ extension. clang-tidy does not support __float128, so it will produce errors in the header files of the standard library.
Modify cStandard or cppStandard to a lower version in VSCode settings, such as c11 or c++14.