emacs-flymake icon indicating copy to clipboard operation
emacs-flymake copied to clipboard

unescaped whitespace based error while using flymake on a c++ header file

Open DirkScharff opened this issue 12 years ago • 6 comments

When i turn on flymake on a header file in my cpp project I can observe flymake correctly determining a master file for it, but the make call failes. That is caused by a whitespace in my work path.

the command flymake tries to evaluate: command=(make -s -C PATH_CONTAINING_WHITESPACE CHK_SOURCES=FILE_PATH_CONTAINING_WHITESPACE SYNTAX_CHECK_MODE=1 check-syntax)

This should be fixable by using >"< to encapsulate the path or escaping whitespaces in the command as far as I see, but sadly I was unable to determine where to put that change with my little lisp knowledge.

DirkScharff avatar Feb 08 '13 15:02 DirkScharff

Thanks for the bug report, looks like it's a failure common to the filename handling in all syntax checks. I've got a fixed version, will release in a short while once I'm done testing.

illusori avatar Feb 08 '13 18:02 illusori

OK, I've pushed a new version out to master that appears to fix the problem for me - I tested with in-temp and in-place checks with a test case that had a space in the file-name of the main project directory the Makefile was in, and a space in the sub-directory that contained the C source file, and a space in the file-name of the C source itself.

That seemed to work for me, but I don't use Flymake for C development, so I'd appreciate it if you could check that it solves your issue before I push it out to Marmalade and possibly break it for everyone. :)

illusori avatar Feb 08 '13 20:02 illusori

Sorry for the delay. I tested the version in master and it fixes my issue. Thank you for your support :)

DirkScharff avatar Feb 11 '13 22:02 DirkScharff

Ok.. it does seem to work on my OSX environment (at home). On Windows (at work) it still fails for me but for another reason. I'm not sure if this is connected to the issue at hand or a configuration error on my side.

I'm attaching a screenshot of a minimal example. Left hand side: header, makefile, cppfile, my flymake config Right hand side: Messages and re-builder

I can find the error message in the Messages buffer with re-builder using the regexp from my config, but flymake doesn't seem to notice it. It works fine with the cpp file.

win_flymake_header_fail

DirkScharff avatar Feb 12 '13 15:02 DirkScharff

That's really useful debug info, I can't see anything immediately obvious though, and won't have time to look into it further tonight. I'll try to find time tomorrow to take a proper look. Thanks for the feedback.

illusori avatar Feb 12 '13 20:02 illusori

I run in a problem which I don't know if it is a bug or a misuse of mine.

If I open a header which is included by a .cpp file in which there's an error I get the CFGERR as make returns exit code 2 but the report for the header is 0 errors.

EDIT: I digged a little more into the code and the problem seems to be that the error is found but not added to the err-info-list:

parse line: type=e file-idx=1 line-idx=3 file=/home/noxdafox/workspace/university/progetto_sistemi_operativi/1/elenco_flymake_master.cpp line=10 text=error: ‘asd’ does not name a type parsed '/home/noxdafox/workspace/university/progetto_sistemi_operativi/1/elenco_flymake_master.cpp:10:1: error: ‘asd’ does not name a type', got line-err-info

This means the error has been parsed.

elenco.h: 0 error(s), 0 warning(s), 0 info in 0.94 second(s)

At the end seems the error was not added to the list as the report gives 0 errors.

noxdafox avatar Apr 21 '13 07:04 noxdafox