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

gcc maker's errorformat should catch fatal errors for missing includes #1024

Closed
NickeZ opened this issue Feb 15, 2017 · 6 comments
Closed

gcc maker's errorformat should catch fatal errors for missing includes #1024

NickeZ opened this issue Feb 15, 2017 · 6 comments

Comments

@NickeZ
Copy link
Contributor

NickeZ commented Feb 15, 2017

I feel very stupid but I can't enable gcc maker. I've tried multiple ways. I have installed neomake with https://github.com/junegunn/vim-plug if that matters.

Expected behavior

gcc maker should be enabled

Steps to reproduce

Put one of the following lines in the vim config:

let g:neomake_cpp_enabled_makers = ['gcc']
let g:neomake_enabled_makers = ['gcc']

Output of the ":verb NeomakeInfo" command

Neomake debug information

Async support: 1
Current filetype: cpp

Enabled makers

For the current filetype (with :Neomake):

  • gcc
    errorformat: '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,%-G%f:%l: %#error: %#for each function it appears%.%#,%-GIn file included%.%#,%-G %#from %f:%l,,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%I%f:%l:%c: note: %m,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %tarning: %m,%I%f:%l:
    note: %m,%f:%l: %m'
    args: ['-fsyntax-only', '-Wall', '-Wextra']
    get_argv: function('2', {'get_argv': function('2')})
    exe: 'g++'
    NOTE: you can define g:neomake_cpp_enabled_makers to configure it (or b:neomake_cpp_enabled_makers).

For the project (with :Neomake!): None.
NOTE: you can define g:neomake_enabled_makers to configure it.

Default maker settings:

  • remove_invalid_entries: 0
  • buffer_output: 1
Settings
g:neomake_place_signs = 1                                                                                                                                                                                                                                                                                                     
g:neomake_c_enabled_makers = ['gcc']                                                                                                                                                                                                                                                                                          
g:neomake_cpp_enabled_makers = ['gcc']                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                              
shell: /bin/bash                                                                                                                                                                                                                                                                                                              
shellcmdflag: -c                                                                                                                                                                                                                                                                                                              
Windows: 0                                                                                                                                                                                                                                                                                                                    

:version

NVIM 0.2.0-dev                                                                                                                                                                                                                                                                                                                
Build type: RelWithDebInfo                                                                                                                                                                                                                                                                                                    
Compilation: /usr/bin/cc -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/builddir/build/BUILD/neovim-0
.1.7-2a366b6/build/config -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/src -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/in
clude -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/build/include                                                                                                                                                                                             
Compiled by mockbuild                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                              
Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui                                                                                                                                                                                                                                                    
For differences from Vim, see :help vim-differences                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                              
   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                                                                                      
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                                                                                                                                                                                       

:messages

"git/epics-modules/m-epics-ifcfastint/src/IFCFastIntDIChannel.cpp" 465L, 17791C                                                                                                                                                                                                                                               
NVIM 0.2.0-dev                                                                                                                                                                                                                                                                                                                
Build type: RelWithDebInfo                                                                                                                                                                                                                                                                                                    
Compilation: /usr/bin/cc -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/builddir/build/BUILD/neovim-0
.1.7-2a366b6/build/config -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/src -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/.deps/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/in
clude -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.1.7-2a366b6/build/include                                                                                                                                                                                             
@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 15, 2017

Related question: How do I add arguments to gcc so that it finds my includes?

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 15, 2017

It seems that it was enabled all along, but it probably didn't parse the error. I got a fatal error because gcc couldn't find a header file.

Then I used let g:neomake_cpp_gcc_args = [... to add my include directories.

@NickeZ NickeZ closed this as completed Feb 15, 2017
@blueyed
Copy link
Member

blueyed commented Feb 15, 2017

I got a fatal error because gcc couldn't find a header file.

The default error format should have matched this, so it can be considered a bug I think.

@blueyed blueyed changed the title How do I enable the gcc maker. gcc maker's errorformat should catch fatal errors for missing includes Feb 15, 2017
@blueyed blueyed reopened this Feb 15, 2017
@blueyed
Copy link
Member

blueyed commented Feb 15, 2017

@NickeZ
Can you post the output from when not using the proper args, i.e. the fatal error, please?

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 21, 2017

@blueyed Sorry, I was probably just confused. By default neomake doesn't open the list of issues and I remember that I looked for some marker in the gutter but I couldn't see one. I can't reproduce the issue any more...

@NickeZ NickeZ closed this as completed Feb 21, 2017
@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 21, 2017

It would have been nice if the readme mentions g:neomake_open_list and that some documentation about the C maker mentions how to set include paths: let g:neomake_c_gcc_args = ['-fsyntax-only', '-Wall', '-Wextra', '-I/arg/to/include']. I looked everywhere and found the solution in some issue..

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

No branches or pull requests

2 participants