Community
Participate
Working Groups
Build ID: M7 I20070503-1400 CDT ID: RC0 200705021527 Steps To Reproduce: 1.Project Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Preprocessor->Add "ulong=unsigned long" or 'ulong=unsigned long' with the quotes. It looks correct in the dialog when it's added. 2."Build Selected File(s)" within the project on any file. The resultant compile is: """ Rebuilding selected file(s) **** Internal Builder is used for build **** g++ -Dulong=unsigned long -Dulong=unsigned long "" The spec states that quotes should be preserved http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/cpp/invocation.html ++G PS. I know that -Dulong=unsigned is ~equivalent, was just using it as an example :)
This bug is related with two other existing bugs: 236227 and 259781. I think this patch will help.
Created attachment 130657 [details] Patch to escape symbol definitions properly
There is a workaround - you can wrap it in second set of quotes. Only one set gets stripped: > 'ulong="unsigned long"' or even > ulong='"unsigned long"'
This patch does not apply cleanly. Can you please regenerate it?
Created attachment 137607 [details] Regenerated patch I have regenerated patch without any changelogs etc. Just for source file. It is diff from CDT 5.0.1 generated by svn. If it doesn't apply, please let me know more details on what problem is.
I can confirm this bug to be present in CDT6.0RC2. Note that it's internal builder bug, and the bug with generated makefiles is different. Dmitry's patch only addresses generated makefile -- shall I open a new bug to track that, or shall I attach 6.0 patch for generated makefiles here?
*** Bug 282845 has been marked as a duplicate of this bug. ***
(In reply to comment #6) > I can confirm this bug to be present in CDT6.0RC2. Note that it's internal > builder bug, and the bug with generated makefiles is different. Dmitry's patch > only addresses generated makefile -- shall I open a new bug to track that, Please, open a new bug for the external builder problem if it is a different issue. Lets continue there. > or shall I attach 6.0 patch for generated makefiles here? I can apply the patch on the HEAD just fine. What I wanted to ask if you guys could provide unit test cases for these changes? There is a bunch of test cases in org.eclipse.cdt.managedbuilder.core.tests. I think you could take a look for example at BuildSystem40Tests or ManagedBuildMacrosTests or another one which suits better and add tests covering your changes? Why don't you attach test case patch to the new task?
Has this been repaired ? I'm using SUSE Linux kernel 2.6.16.60-0.21-smp (SGI x86) Eclipse 3.5.2R35x_v2010021 Intel's icc/icpc V11.1 compiler and their Eclipse integration which uses CDT Version 6.0.201002161416 Build id : 201002161416 I'm encountering this same bug. The workaround doesn't work in all cases. i.e. add a symbol CURRDIR value "${CWD}" this returns a compiler command line : Invoking: Intel Intel(R) 64 C++ Compiler icpc -D"CURRDIR="/export/home/0094750/workspace/HelpMe/Release" .... sticks an extra double quote after the -D -------------------------- using '"${CWD}"' as the suggested workaround results in : icpc -D"CURRDIR='"/export/home/0094750/workspace/HelpMe/Release"'" even worse. -------------------------- using '${CWD}' results in : icpc -D"CURRDIR='/export/home/0094750/workspace/HelpMe/Release'" no better. -------------------------- using : '"${CWD}/mydir"' icpc -D"CURRDIR='"/export/home/0094750/workspace/HelpMe/Release/mydir"'" -------------------------- using : "/mydir/subdir1" Invoking: Intel Intel(R) 64 C++ Compiler icpc -DCURRDIR="/mydir/subdir1" -MMD -MP -MF"src/HelpMe.d" -MT"src/HelpMe.d" -c -o "src/HelpMe.o" "../src/HelpMe.cpp" ../src/HelpMe.cpp(16): error: expected an expression cout << CURRDIR << endl; ^ -------------------------- using : '"/mydir/subdir1"' (surrounded with single quotes) icpc -DCURRDIR='"/mydir/subdir1"' -MMD -MP -MF"src/HelpMe.d" -MT"src/HelpMe.d" -c -o "src/HelpMe.o" "../src/HelpMe.cpp" Finished building: ../src/HelpMe.cpp does work with output : cout << CURRDIR << endl; /mydir/subdir1 -------------------------- using : '"/mydir${CWD}/subdir1"' icpc -D"CURRDIR='"/mydir/export/home/0094750/workspace/HelpMe/Release/subdir1"'" -MMD -MP -MF"src/HelpMe.d" -MT"src/HelpMe.d" -c -o "src/HelpMe.o" "../src/HelpMe.cpp" ../src/HelpMe.cpp(16): warning #2221: too many characters in character literal -- extra leading characters ignored cout << CURRDIR << endl; ^ -------------------------- using : icpc -D"CURRDIR="/mydir/export/home/0094750/workspace/HelpMe/Release/subdir1" ... HelpMe.cpp /bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: syntax error: unexpected end of file -------------------------- using : '/mydir${CWD}/subdir1' icpc -D"CURRDIR='/mydir/export/home/0094750/workspace/HelpMe/Release/subdir1'" .... HelpMe.cpp" ../src/HelpMe.cpp(16): warning #2221: too many characters in character literal -- extra leading characters ignored cout << CURRDIR << endl; ^ -------------------------- using : '\"/mydir${CWD}/subdir1\"' icpc -D"CURRDIR='\"/mydir/export/home/0094750/workspace/HelpMe/Release/subdir1\"'" .... /HelpMe.cpp" ../src/HelpMe.cpp(16): warning #2221: too many characters in character literal -- extra leading characters ignored cout << CURRDIR << endl; ^ -------------------------- using : ""/mydir${CWD}/subdir1"" Invoking: Intel Intel(R) 64 C++ Compiler icpc -D"CURRDIR=""/mydir/export/home/0094750/workspace/HelpMe/Release/subdir1"" -MMD -MP -MF"src/HelpMe.d" -MT"src/HelpMe.d" -c -o "src/HelpMe.o" "../src/HelpMe.cpp" /bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: syntax error: unexpected end of file Plus when I open up the symbols dialog, it now looks like : ""/mydir${CWD}/subdir1" -------------------------- Is there a maintenance build of 6.0.2 that I can grab, this is very frustrating. I see the patch, but short of rebuilding CDT, is there a compiled version of the JAR available ? Thanks, Mike
P.S. this fix is NOT in the list of bug fixes for 6.0.2, 6.0.1, or 6.0.
(In reply to comment #9) > Has this been repaired ? I'm using No it hasn't. I plan to work on this eventually but it is not in the priority list. This change needs to be covered with unit test cases. If Dmitry somebody is willing to write those that would speed it up. Thanks for the extra use cases though. Are you using Internal or External builder?
Andrew : >>> Are you using Internal or External builder? According to the C++ Build options, Builder Type is : External builder I was hoping this was fixed since it's been a while. I do realize it's low priority. Is there an alternate way to pass in an external path. Right now our manual build make file ABC_HOME=`pwd`; export ABC_HOME; CONFIGURATION_FILEPATH = \"$(ABC_HOME)/bin/abc_mgmt.config\" then compile line : $(CPP64) $(CPP64_FLAGS) -DCONFIGURATION_FILEPATH=$(CONFIGURATION_FILEPATH) .... in code : config_file = fopen( CONFIGURATION_FILEPATH, "r" ); That's what I'm trying to accomplish moving to Eclipse/CDT. Thanks, Mike
(In reply to comment #5) > Created an attachment (id=137607) > Regenerated patch This patch applies cleanly on BuildEntryStorage.java 1.11.
Note that after applying this patch dialog "Paths and Symbols" -> Symbols -> Edit adds escaping to quotes and backslashes upon entering under user's fingers. Before the patch it would do just bug 309158.