Skip to content

Options like -iquote can have a <dir> attached, without whitespace. - #5167

Open
mmjo wants to merge 1 commit into
dense-analysis:masterfrom
mmjo:fix_c_attached_path
Open

Options like -iquote can have a <dir> attached, without whitespace.#5167
mmjo wants to merge 1 commit into
dense-analysis:masterfrom
mmjo:fix_c_attached_path

Conversation

@mmjo

@mmjo mmjo commented Aug 29, 2026

Copy link
Copy Markdown

gcc and clang accept both '-iquote<dir>' and '-iquote <dir>'.

Just like '-I.' and '-I .', which was already accepted.

Same for '-isystem', '-idirafter' and '-iframework'.

@mmjo
mmjo requested a review from w0rp as a code owner August 29, 2026 20:34
@mmjo

mmjo commented Aug 30, 2026

Copy link
Copy Markdown
Author

I tried to create an issue, but somehow github does not allow that.
Here is the text:

In a Makefile, -iquote. fails with gcc/clang

Information

VIM version

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 24 2026 22:13:04)
Included patches: 1-16, 647, 678, 697

Operating System: Ubuntu 24.04

What went wrong

Building tmux, with gcc, running linter on save, i get:
gcc|1 error| cc : cannot specify '-o' with '-c', '-S' or '-E' with multiple files

Or with clang:
clang|1 error| cc : no such file or directory: '/mnt/data/download/src/tmux/-std=gnu99'

Reproducing the bug

let b:ale_c_parse_makefile=1
Makefile contains -iquote. without separating whitespace.

Running the cc (gcc) linter.
The code takes the next argument as directory to -iquote.
This results in the multiple files error.

:ALEInfo

Expand Current Filetype: c Available Linters: ['astgrep', 'cc', 'ccls', 'clangcheck', 'clangd', 'clangtidy', 'cppcheck', 'cpplint', 'cquery', 'cspell', 'flawfinder'] Linter Aliases: 'cc' -> ['gcc', 'clang'] Enabled Linters: ['cc', 'flawfinder'] Ignored Linters: [] Suggested Fixers: 'ast-grep' - Apply ast-grep rules. 'astyle' - Fix C/C++ with astyle. 'clang-format' - Fix C, C++, C#, CUDA, Java, JavaScript, JSON, ObjectiveC and Protobuf 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. 'replace_emdash' - Replace em dash with -- ASCII characters. '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_c_always_make = 1
let g:ale_c_build_dir = ''
let g:ale_c_build_dir_names = ['build', 'build/Debug', 'build/Release', 'bin']
let g:ale_c_cc_executable = 'gcc'
let g:ale_c_cc_header_exts = ['h']
let g:ale_c_cc_options = ''
let g:ale_c_cc_use_header_lang_flag = -1
let g:ale_c_flawfinder_error_severity = 6
let g:ale_c_flawfinder_executable = 'flawfinder'
let g:ale_c_flawfinder_minlevel = 5
let g:ale_c_flawfinder_options = ''
let g:ale_c_parse_compile_commands = 0
let g:ale_c_parse_makefile = 0
let b:ale_c_parse_makefile = 1

Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:false
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 500
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_disable_lsp = 'auto'
let g:ale_echo_cursor = v:true
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_format = '%linter% %code%: %s'
let g:ale_echo_msg_info_str = 'I'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {'c': ['trim_whitespace', 'remove_trailing_lines']}
let g:ale_history_enabled = v:true
let g:ale_info_default_mode = 'preview'
let g:ale_history_log_output = v:true
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {'c': ['cc', 'flawfinder']}
let g:ale_linters_explicit = 1
let g:ale_linters_ignore = {'c': ['cpplint', 'cquery', 'cspell']}
let g:ale_list_vertical = v:false
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%linter% %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 = 1
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = v:false
let g:ale_set_highlights = 1
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_set_signs = 1
let g:ale_sign_column_always = v:false
let g:ale_sign_error = 'e'
let g:ale_sign_info = 'i'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = 'e'
let g:ale_sign_style_warning = 'w'
let g:ale_sign_warning = 'w'
let g:ale_sign_highlight_linenrs = v:false
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = v:false
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'current'
let g:ale_warn_about_trailing_blank_lines = v:true
let g:ale_warn_about_trailing_whitespace = v:true

Command History:

(executable check - success) gcc
(finished - exit code 0) ['env', 'BASH_ENV=/home/mike/etc/bash/alias.bash', '/bin/bash', '-O', 'expand_aliases', '-c', 'cd ''/mnt/data/download/src/tmux'' && make -n --always-make']

<<>>

(finished - exit code 1) ['env', 'BASH_ENV=/home/mike/etc/bash/alias.bash', '/bin/bash', '-O', 'expand_aliases', '-c', 'cd ''/mnt/data/download/src/tmux'' && ''gcc'' -S -x c -o /dev/null -iquote ''/mnt/data/download/src/tmux'' -DPACKAGE_NAME="tmux" -DPACKAGE_TARNAME="tmux" -DPACKAGE_VERSION="next-3.7" -DPACKAGE_STRING="tmux\ next-3.7" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="tmux" -DVERSION="next-3.7" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -DSTDC_HEADERS=1 -D_ALL_SOURCE=1 -D_DARWIN_C_SOURCE=1 -D_GNU_SOURCE=1 -D_HPUX_ALT_XOPEN_SOCKET_API=1 -D_NETBSD_SOURCE=1 -D_OPENBSD_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D__STDC_WANT_IEC_60559_ATTRIBS_EXT__=1 -D__STDC_WANT_IEC_60559_BFP_EXT__=1 -D__STDC_WANT_IEC_60559_DFP_EXT__=1 -D__STDC_WANT_IEC_60559_FUNCS_EXT__=1 -D__STDC_WANT_IEC_60559_TYPES_EXT__=1 -D__STDC_WANT_LIB_EXT2__=1 -D__STDC_WANT_MATH_SPEC_FUNCS__=1 -D_TANDEM_SOURCE=1 -D__EXTENSIONS__=1 -DHAVE_DIRENT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_PATHS_H=1 -DHAVE_PTY_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_LIBM=1 -DHAVE_DIRFD=1 -DHAVE_FLOCK=1 -DHAVE_PRCTL=1 -DHAVE_SYSCONF=1 -DHAVE_ASPRINTF=1 -DHAVE_CFMAKERAW=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_CLOSEFROM=1 -DHAVE_EXPLICIT_BZERO=1 -DHAVE_GETDTABLESIZE=1 -DHAVE_GETLINE=1 -DHAVE_MEMMEM=1 -DHAVE_SETENV=1 -DHAVE_STRCASESTR=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRSEP=1 -DHAVE_EVENT2_EVENT_H=1 -DHAVE_NCURSES_H=1 -DHAVE_TIPARM=1 -DHAVE_TIPARM_S=1 -DHAVE_B64_NTOP=1 -DHAVE_MALLOC_TRIM=1 -DHAVE_DAEMON=1 -DHAVE_FORKPTY=1 -DHAVE___PROGNAME=1 -DHAVE_PROGRAM_INVOCATION_SHORT_NAME=1 -DHAVE_PR_SET_NAME=1 -DHAVE_SO_PEERCRED=1 -DHAVE_PROC_PID=1 -I ''/mnt/data/download/src/tmux'' -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DTMUX_VERSION=''"next-3.7"'' -DTMUX_CONF=''"/etc/tmux.conf:/.tmux.conf:$XDG_CONFIG_HOME/tmux/tmux.conf:/.config/tmux/tmux.conf"'' -DTMUX_LOCK_CMD=''"lock -np"'' -DTMUX_TERM=''"tmux-256color"'' -DDEBUG -iquote. ''/mnt/data/download/src/tmux/-std=gnu99'' -O2 -Wno-long-long -Wall -W -Wformat=2 -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare -Wundef -Wbad-function-cast -Winline -Wcast-align -Wdeclaration-after-statement -Wno-pointer-sign -Wno-attributes -Wno-unused-result -Wno-format-y2k - < ''/home/mike/tmp/vim/vumKaDv/3/tmux.c''']

<<>>
gcc: fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’ with multiple files
compilation terminated.
<<>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant