Open mingodad opened 8 months ago
Also testing https://github.com/abseil/abseil-cpp with the Lua
script shown bellow gives this result:
#cxx
Total files scanned : 172
Total files with code : 0
Total files failed code : 47
#clang-17
Total files scanned : 172
Total files with code : 0
Total files failed code : 3
#g++-13
Total files scanned : 172
Total files with code : 0
Total files failed code : 71
#circle-200
Total files scanned : 172
Total files with code : 0
Total files failed code : 59
local base_dir = "/home/mingo/dev/c/A_libs/abseil-cpp/absl/";
--local cxx_cmd = "/usr/bin/time ../build/src/frontend/cxx -fsyntax-only -toolchain linux ";
local cxx_cmd = "/usr/bin/time ../build-release/src/frontend/cxx -fsyntax-only -toolchain linux ";
--local cxx_cmd = "clang-17-env /usr/bin/time clang++ -std=c++14 -fsyntax-only ";
--local cxx_cmd = "clang-17-env /usr/bin/time clang++ -fsyntax-only ";
--local cxx_cmd = "gcc-13-env /usr/bin/time g++ -std=c++14 -fsyntax-only ";
--local cxx_cmd = "gcc-13-env /usr/bin/time g++ -fsyntax-only ";
--local cxx_cmd = "/usr/bin/time timeout 3s circle -fsyntax-only ";
local find_cmd = "find " .. base_dir .. " -name '*.cc'";
local start_t = os.time();
local cpp_list = {};
for fname in io.popen(find_cmd, "r"):lines("l") do
if not (fname:match("_test.cc$") or fname:match("_benchmark.cc$")) then
table.insert(cpp_list, fname);
end
end
table.sort(cpp_list);
local count_with_code = 0;
local fname_with_code_failed = {};
for idx, fname in ipairs(cpp_list) do
print(fname);
local cmd = cxx_cmd .. fname .. " -I" .. base_dir .. "..";
print("==CHECK==")
print(cmd);
io.stdout:flush();
local rc = os.execute(cmd);
if rc then
print("==rc:OK==")
else
table.insert(fname_with_code_failed, idx);
print("==rc:FAILED==")
end
end
local end_t = os.time();
print("elapsed time: ", os.difftime(end_t, start_t));
print("Total files scanned :", #cpp_list);
print("Total files with code :", count_with_code);
print("Total files failed code :", #fname_with_code_failed);
for idx, fname_idx in ipairs(fname_with_code_failed) do
print(cpp_list[fname_idx]);
end
See attached cxx
and clang
output:
test-abseil-cpp-cxx.output.zip
test-abseil-cpp-clang17.output.zip
This looks very helpful, thanks for sharing. I will have a look at the failures, do you have a repo for this?
No repo only the Lua
script and you can download the offline cpp-reference from here https://en.cppreference.com/w/Cppreference:Archives .
Now when trying to test I'm getting errors that was not happening before:
/home/mingo/.local/share/Zeal/Zeal/docsets/C++.docset/Contents/Resources/Documents/en.cppreference.com/w/cpp/algorithm/accumulate.html
==CHECK==
/usr/bin/time ./cxx -fsyntax-only -toolchain linux /tmp/cppCode.cpp
/usr/include/c++/11/ext/numeric_traits.h:72:57: expected '('
= __is_integer_nonstrict<_Value>::__width - __is_signed;
^
/usr/include/c++/11/ext/numeric_traits.h:76:2: expected '('
? (((((_Value)1 << (__digits - 1)) - 1) << 1) + 1)
^
/usr/include/c++/11/ext/numeric_traits.h:78:47: expected '('
static const _Value __min = __is_signed ? -__max - 1 : (_Value)0;
^
/usr/include/c++/11/bits/stl_algobase.h:907:40: expected '('
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:907:54: expected a declaration
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:907:60: expected a declaration
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:1055:40: expected '('
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:1055:54: expected a declaration
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:1055:71: expected a declaration
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
^
/usr/include/c++/11/bits/stl_algobase.h:1372:18: expected '('
&& __is_pointer<_II1>::__value
^
/usr/include/c++/11/bits/stl_algobase.h:1373:18: expected '('
&& __is_pointer<_II2>::__value
^
Command exited with non-zero status 1
0.22user 0.03system 0:00.26elapsed 98%CPU (0avgtext+0avgdata 51712maxresident)k
104inputs+0outputs (0major+13959minor)pagefaults 0swaps
==rc:FAILED==
I see, I think I broke this when I started reworking the support for the built-in type traits. https://github.com/robertoraggi/cplusplus/pull/359 should fix it, I also added some code to test the linux toolchain in the CI workflow. Thanks for the report.
Using the
Lua
script shown bellow to extract the code examples from https://en.cppreference.com/w/ I'm getting this results:See attached the output for
cxx
andclang-17
: test-cpp-reference-examples-cxx.output.zip test-cpp-reference-examples-clang-17-std23.output.zip