Navigation Menu

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

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

Open
DirkScharff opened this issue Feb 8, 2013 · 6 comments

Comments

@DirkScharff
Copy link

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.

@illusori
Copy link
Member

illusori commented Feb 8, 2013

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
Copy link
Member

illusori commented Feb 8, 2013

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. :)

@DirkScharff
Copy link
Author

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

@DirkScharff
Copy link
Author

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

@illusori
Copy link
Member

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.

@noxdafox
Copy link

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.

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

No branches or pull requests

3 participants