Running external tools in spaces with paths from tools.xml
Hello,
I am using CrossWorks for ARM v3.7.6 on Windows 7 x64 and am trying to get it set up to run PC-Lint.
I created the tools.xml file by using the File menu -> Open Studio Folder -> External Tools Configuration and it created the file with a sample for PC-Lint. My tools.xml is like this, which the command all on one line:
<tools>
<if host_os="win">
<item name="Tool.PClint">
<menu>&PC-lint (Unit Check)</menu>
<text>PC-lint (Unit Check)</text>
<tip>Run a PC-lint unit checkout on the selected file or folder</tip>
<key>Ctrl+L, Ctrl+P</key>
<match>*.c;*.cpp</match>
<message>Linting</message>
<commands>
"$(LINTDIR)/lint-nt" -v -incvar(__CW_ARM) -i$(LINTDIR)/lnt co-cw-arm.lnt lib-ctl.lnt $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros +macros -w2 -e537 +fie +ffn -width(0,4) -hF1 "-format=%f:%l:%C:\s%t:\s%m [-e%n]" "$(InputPath)"
</commands>
</item>
</if>
</tools>
I set my project options to include the LINTDIR global macro. I've created the files required by co-gcc, and created an empty co-cw-arm.lnt and lit-ctl.lnt in the same directory as a test source for now.
I run lint from the IDE and there seems to be a problem with the quoting of pathnames. In the output window for lint I get:
Linting
Linting main.c
Command line: C:\Program Files (x86)\PC-lint 9.0/lint-nt -v -incvar(__CW_ARM) -iC:\Program Files (x86)\PC-lint 9.0/lnt co-cw-arm.lnt lib-ctl.lnt -D__SIZEOF_WCHAR_T=4 -D__ARM_ARCH_4T__ -D__CROSSWORKS_ARM -D__CROSSWORKS_MAJOR_VERSION=3 -D__CROSSWORKS_MINOR_VERSION=7 -D__CROSSWORKS_REVISION=6 -DDEBUG -D__FLASH_BUILD -D__ARM -IC:/Program Files (x86)/Rowley Associates Limited/CrossWorks for ARM 3.7/include -IC:/Users/user/AppData/Local/Rowley Associates Limited/CrossWorks for ARM/v3/packages/include -I. -D__GNUC__ -u -b +macros +macros -w2 -e537 +fie +ffn -width(0,4) -hF1 -format=%f:%l:%C:\s%t:\s%m [-e%n] C:/Users/user/Desktop/lnt/main.c
Working directory: C:/Users/user/Desktop/lnt
Error 305: Unable to open module 'Files'
Finished Linting
The error 305 implies that PC-Lint is being run and that it is being passed a file "Files" (which would be an unquoted C:/Program Files (x86). Since PC-Lint is being run I have to assume that the " markers from tools.xml are being parsed correctly but not displayed correctly in the Output window. Is there a way to see the exact raw command line with quotes?
That makes me think the error is in the $(INCLUDES) expansion and paths are not being quoted. I tried adding quotes to those in Project Properties -> C/C++ -> Preprocessor -> System Include Directories but it did not change the output. I know I could add these manually to tools.xml but if I change my paths in the project options I need to remember to change tools.xml, which is hardly ideal.
If I run the same command line with quotes manually added in, from a command prompt, then I get lint output messages as I would expect.
I've read the External Tools file format in the help documentation, but it doesn't seem to help. I have the " markers around the places I can put it and they don't get displayed in the Output window. But even if they did, I don't know if the $(INCLUDES) variable is quoted when expanded?
I've also read the forum post at https://rowley.zendesk.com/hc/en-us/community/posts/205393733-Example-external-tool-configurations and it hasn't helped.
So, can anyone else confirm or have a way to work around it, short of reinstalling CrossWorks and Lint in directories without spaces?
-
I noticed I was missing a couple of "s around the -i$(LINTDIR)/lnt so I added those but still have the same issue.
If I manually replace the $(INCLUDES) with the path and put the quotes in then it works fine. Is there any way to use $(INCLUDES) and have them individually quoted?
Please sign in to leave a comment.
Comments
1 comment