dense-analysis / dense-analysis/ale
Standard header(s) not found during lint
- Dominant language
- Vim Script
- Stars
- 14k
- Forks
- 1.5k
- Avg merge
- 17h 49m
- Merged PRs (30d)
- 1
Description
## Information
**VIM version**
NVIM v0.8.0-dev-730-g161efc9ea
Build type: Release
Operating System: Ubuntu 20.04
## What went wrong
`ALEDetail` shows for my larger project
```
1 In file included from :3:
2 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/filters/crop_box.h:42:
3 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/filters/filter_indices.h:42:
4 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/filters/filter.h:42:
5 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/pcl_base.h:46:
6 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/memory.h:46:
7 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/type_traits.h:40:
8 In file included from /home/autocrane/deps/include/pcl-1.12/pcl/point_struct_traits.h:40:
9 In file included from /home/autocrane/deps/include/boost/mpl/assert.hpp:17:
10 In file included from /home/autocrane/deps/include/boost/mpl/not.hpp:17:
11 In file included from /home/autocrane/deps/include/boost/mpl/bool.hpp:17:
12 In file included from /home/autocrane/deps/include/boost/mpl/bool_fwd.hpp:17:
13 In file included from /home/autocrane/deps/include/boost/mpl/aux_/adl_barrier.hpp:17:
14 In file included from /home/autocrane/deps/include/boost/mpl/aux_/config/adl.hpp:17:
15 In file included from /home/autocrane/deps/include/boost/mpl/aux_/config/msvc.hpp:19:
16 In file included from /home/autocrane/deps/include/boost/config.hpp:44:
17 /home/autocrane/deps/include/boost/config/detail/select_stdlib_config.hpp:26:14: fatal error: 'cstddef' file not found
18 # include
19 ^~~~~~~~~
20 Stack dump:
21 0.>-Program arguments: /usr/bin/clang++ -S -x c++ -o /dev/null -iquote […]
```
So this standard header is not found.
## Reproducing the bug
For a minimal reproduction, have cpp file
```
#include
int main(int argc, char *argv[])
{
return 0;
}
```
Have cmakelists
```
project(wat)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(wat wat.cpp)
```
observe as ALE complains `'cstddef' file not found`.
### :ALEInfo
Expand
:ALEInfo
Current Filetype: cpp
Available Linters: ['cc', 'ccls', 'clangcheck', 'clangd', 'clangtidy', 'clazy', 'cppcheck', 'cpplint', 'cquery', 'cspell', 'flawfinder']
Linter Aliases:
'cc' -> ['gcc', 'clang', 'g++', 'clang++']
Enabled Linters: ['cc', 'clangtidy']
Ignored Linters: []
Suggested Fixers:
'astyle' - Fix C/C++ with astyle.
'clang-format' - Fix C/C++ and cuda files with clang-format.
'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.
Linter Variables:
let g:ale_cpp_cc_executable = '/usr/bin/clang++'
let g:ale_cpp_cc_options = '-std=c++14 -Wall'
let g:ale_cpp_clangtidy_checks = []
let g:ale_cpp_clangtidy_executable = 'clang-tidy'
let g:ale_cpp_clangtidy_extra_options = '-p compile_commands.json'
let g:ale_cpp_clangtidy_options = ''
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'cpp': ['clang', 'clangtidy']}
let g:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) /usr/bin/clang++
<<>>
:1:10: fatal error: 'cstddef' file not found
#include
^~~~~~~~~
1 error generated.
<<>>
(executable check - failure) clang-tidy
Contributor guide
Research direction
Start with the ALEInfo output, the enabled cpp `clang` linter, and the `/usr/bin/clang++` command history. Reproduce the failure with the shown `wat.cpp` and CMakeLists, then trace how ALE constructs the C++ lint command and compare it with the project compilation context. Done means the minimal CMake reproduction no longer reports `cstddef` as missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, vim
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100