[vim/vim] :make does not add entries to the quickfix list or the location list (Issue #14967)

25 views
Skip to first unread message

AMF064

unread,
Jun 11, 2024, 7:13:14 PM6/11/24
to vim/vim, Subscribed

Steps to reproduce

  1. Write a program in any language. Example in C:
#include <stdio.h>

int main(void)
{
    printf("%d\n",a);
    return 0;
}
  1. Configure the makeprg. In the example's case:
:set makeprg=cc\ %
  1. Run make.

Expected behaviour

The example program issues an error saying a is undeclared, so the quickfix list should have at least an entry. Nevertheless, it is empty for me. This does not happen with grep, apparently it only happens with make for me.

I am a beginner in GitHub, this is my first issue in an open-source project. If I missed some important information, please let me know. Thank you for your attention.

Version of Vim

9.1

Environment

OS: arch 6.9.1
Terminal: st-256color

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967@github.com>

Quan Nguyen

unread,
Jun 11, 2024, 11:35:52 PM6/11/24
to vim/vim, Subscribed

Can't reproduce it. Can you try to open vim with "vim -u NONE" and try again?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2162039258@github.com>

Christian Brabandt

unread,
Jun 12, 2024, 2:22:44 AM6/12/24
to vim/vim, Subscribed

Make sure your 'errorformat' option is properly setup. This should work, when the file you compile, is actually a C file type, e.g. using vim --clean foobar.c should set this up correctly.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2162194822@github.com>

AMF064

unread,
Jun 12, 2024, 7:41:40 AM6/12/24
to vim/vim, Subscribed

Hi, thanks for the quick response.
I tried the ways you told me, the issue persists. I checked the &errorformat variable, it is the one specified in the gcc.vim file located in the runtime path. Still, nothing happens to the quickfix list. When I hit :make and it finishes, Vim does not display any errors, and the message queue does not have any either.
Nevertheless, I tried in virtual machines with other OS's, whose Vim version was also 9.1, and it worked. I don't know to what extent it can be an issue with my particular machine. I will try making a VM with my current OS to help you narrow down the problem.
Thank you!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2162795056@github.com>

AMF064

unread,
Jun 12, 2024, 9:04:05 AM6/12/24
to vim/vim, Subscribed

Okay, I tried installing my OS in a VM, and it works just fine. I also tried my configuration and it also worked. It must be something in my particular machine. I have no idea what it could be. Any clue? Thanks for your help.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2162957515@github.com>

Quan Nguyen

unread,
Jun 12, 2024, 9:20:39 AM6/12/24
to vim/vim, Subscribed

Does running ":!cc %" output any thing?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2162992893@github.com>

AMF064

unread,
Jun 12, 2024, 9:50:04 AM6/12/24
to vim/vim, Subscribed

Yes, it does. I'm using GCC as my compiler. It outputs the error:

main.c: In function ‘main’:
main.c:5:20: error: ‘a’ undeclared (first use in this function)
    5 |     printf("%d\n", a);
      |                    ^
main.c:5:20: note: each undeclared identifier is reported only once for each function it appears in


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2163061389@github.com>

AMF064

unread,
Jun 12, 2024, 9:59:55 AM6/12/24
to vim/vim, Subscribed

I've tried the following:

  1. Set makeprg to some command that outputs something:
:set makeprg=echo\ Hello
  1. Run make

It outputs what I want it to write, and the quickfix list gets an entry with that "Hello" text. What does this mean?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2163083988@github.com>

Christian Brabandt

unread,
Jun 12, 2024, 2:12:09 PM6/12/24
to vim/vim, Subscribed

can you please show the various shell options? Perhaps :set shellredir is set wrongly? Is there a difference between your shell and the one in your VM?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2163635394@github.com>

AMF064

unread,
Jun 12, 2024, 4:46:13 PM6/12/24
to vim/vim, Subscribed

It is true, it's different in the VM. In my machine, it is > by default, and in the VM, it is >%s 2>&1. I've tried to change it setting shellredir in the .vimrc, but the quickfix still doesn't receive the output from the compiler.

Now that I've read the documentation, I notice that I forgot to tell you my shell, it is oksh at the moment. But I've tried it with bash as well, it still does not work.

With shell options, do you mean set -o?

Thank you so much for your patience.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2163869360@github.com>

Christian Brabandt

unread,
Jun 13, 2024, 2:53:02 AM6/13/24
to vim/vim, Subscribed

I mean the various shell options in Vim. See :h 'shell' and the following options.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2164681771@github.com>

AMF064

unread,
Jun 13, 2024, 6:36:49 AM6/13/24
to vim/vim, Subscribed

In my machine:

  • shell: /usr/bin/oksh
  • shelltype: 0
  • shellpipe: | tee
  • shellslash: 0
  • shellredir: >%s 2>&1
  • shellquote: ``
  • shellxquote: ``
  • shellcmdflag: -c
    In the VM:
  • shell: /bin/bash
  • shelltype: 0
  • shellpipe: 2>&1| tee
  • shellslash: 0
  • shellredir: >%s 2>&1
  • shellquote: ``
  • shellxquote: ``
  • shellcmdflag: -c

I changed the shellpipe option to the one used in the VM and it worked. Thank you for your help, I did not know about these options. In order to have it working all the time, shall I set the option in my .vimrc?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2165270380@github.com>

Christian Brabandt

unread,
Jun 13, 2024, 6:44:54 AM6/13/24
to vim/vim, Subscribed

Hm, we have some special casing for zsh and bash I believe. I have never heard of oksh, not sure if we need to add some defaults to it (and if we should, what those defaults should be). So for the time being, yes you need to properly configure all those shell options, if the defaults are not working for you.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14967/2165287882@github.com>

Christian Brabandt

unread,
Jun 13, 2024, 1:17:00 PM6/13/24
to vim/vim, Subscribed

Closed #14967 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/14967/issue_event/13150412842@github.com>

Reply all
Reply to author
Forward
0 new messages