When I set makeprg using:
set makeprg=gcc\ -Wall\ -g\ %\ -o\ %
and then invoke :make Vim does not pass proper filenames, because this command is translated as:
gcc -Wall -g file.c -o file.c
and executed. The compiler is then complaining that input and output files are the same, which is in fact dangerous. My question is how to change the second % in makeprg to have it without .c extension. The command exectuted should be like this:
gcc -Wall -g file.c -o file
I don't know what to put instead the second %.