Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't open /dev/null.su for writing: Permission denied #3200

Closed
fuzhen011 opened this issue Jun 8, 2020 · 3 comments
Closed

can't open /dev/null.su for writing: Permission denied #3200

fuzhen011 opened this issue Jun 8, 2020 · 3 comments
Labels

Comments

@fuzhen011
Copy link

Information

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 26 2020 06:16:44)

MacOS Catalina 10.15.5

What went wrong

When I use vim to open some source or header files in the project, it shows me "can't open /dev/null.su for writing: Permission denied" error on the first line of the file.

:ALEInfo

Current Filetype: c
Available Linters: ['ccls', 'clang', 'clangd', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder', 'gcc']
Enabled Linters: ['clangd', 'gcc']
Suggested Fixers:
'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_c_build_dir = ''
let g:ale_c_build_dir_names = ['build', 'GNU ARM v7.2.1 - Default']
let g:ale_c_clangd_executable = 'clangd'
let g:ale_c_clangd_options = ''
let g:ale_c_gcc_executable = 'arm-none-eabi-gcc'
let g:ale_c_gcc_options = '-mcpu=cortex-m3 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DSTM32F103xB -DDEBUG -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/CMSIS/Device/ST/STM32F1xx/Include -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/CMSIS/Include -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Core/Inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/STM32F1xx_HAL_Driver/Inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/src -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/src/log_module -Wall --specs=nano.specs -mfloat-abi=soft -mthumb'
let g:ale_c_parse_compile_commands = 1
let g:ale_c_parse_makefile = 0
let g:ale_c_uncrustify_options = '-c ~/.uncrustify.cfg -l C --replace'
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_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 = {'vim': ['trim_whitespace'], 'cmake': ['cmakeformat', 'trim_whitespace'], 'c': ['uncrustify', 'trim_whitespace'], 'xml': ['xmllint', 'trim_whitespace'], 'json': ['prettier', 'trim_whitespace'], 'sh': ['shfmt', 'trim_whitespace'], '*': ['remove_trailing_lines'], 'cpp': ['uncrustify', 'trim_whitespace'], 'markdown': ['prettier'], 'python': ['autopep8', 'isort', 'trim_whitespace']}
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 = 1
let g:ale_linter_aliases = {}
let g:ale_linters = {'c': ['gcc', 'clangd'], 'cpp': ['gcc', 'clangd'], 'python': ['pylint']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
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_set_balloons = 0
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = 'E'
let g:ale_sign_info = 'W'
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 = 0
let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK']
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 - failure) clangd
(finished - exit code 1) ['/bin/zsh', '-c', '''arm-none-eabi-gcc'' -S -x c -o /dev/null -iquote ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/src'' -mcpu=cortex-m3 -std=gnu11 -DSTM32F10X_MD -DUSE_HAL_DRIVER -DSTM32F103xB -DDEBUG -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../inc'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../src/log_module'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../Drivers/CMSIS/Device/ST/STM32F1xx/Include'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../Drivers/CMSIS/Include'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../Core/Inc'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy'' -I ''/Users/zhfu/STM32CubeIDE/workspace_1.3.0/version_second/Debug/../Drivers/STM32F1xx_HAL_Driver/Inc'' -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -mfloat-abi=soft -mthumb -mcpu=cortex-m3 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DSTM32F103xB -DDEBUG -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/CMSIS/Device/ST/STM32F1xx/Include -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/CMSIS/Include -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Core/Inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/Drivers/STM32F1xx_HAL_Driver/Inc -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/src -I$HOME/STM32CubeIDE/workspace_1.3.0/versoin_second/src/log_module -Wall --specs=nano.specs -mfloat-abi=soft -mthumb - < ''/var/folders/99/0wv0ssm1261890_flt8mq35x543lc3/T/vkdbLYS/3/store.c''']

<<>>
:1:0: fatal error: can't open /dev/null.su for writing: Permission denied
compilation terminated.
<<>>

@fuzhen011 fuzhen011 added the bug label Jun 8, 2020
@fuzhen011
Copy link
Author

Digging it a little bit and found this is caused by the command option "-fstack-usage", in GCC document page, we can see below description to the option.

Makes the compiler output stack usage information for the program, on a per-function basis. The filename for the dump is made by appending .su to the auxname. auxname is generated from the name of the output file, if explicitly specified and it is not an executable, otherwise it is the basename of the source file.

@w0rp w0rp mentioned this issue Aug 9, 2020
12 tasks
@w0rp
Copy link
Member

w0rp commented Aug 9, 2020

Almost all C/C++ issues with flags should now be discussed in #3276, so a comprehensive solution can be found for most people, for automatically detecting flags.

@w0rp
Copy link
Member

w0rp commented Aug 19, 2020

@fuzhen011 I've pushed a fix for this issue now. -fstack-usage is now removed from parsed C flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants