Bug 262219 - [Scanner Discovery] why does linux gcc support perFile discovery with c projects and not c++ projects?
Summary: [Scanner Discovery] why does linux gcc support perFile discovery with c proje...
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 5.0.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-23 13:42 EST by Miwako Tokugawa CLA
Modified: 2010-06-11 07:43 EDT (History)
5 users (show)

See Also:


Attachments
profile definition example (2.62 KB, text/plain)
2009-03-06 15:22 EST, Alex Chapiro CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miwako Tokugawa CLA 2009-01-23 13:42:06 EST
If I create a hello world program that includes a standard header, I get "Unresolved inclusion" warning mark on it.
What's the reason that CDT issues a warning even for a standard header such as <stdio.h>?
I understand the warning can be eliminated by adding Include directories under "Pasths and Symbols". But I would think /usr/include should be added there by default.
Comment 1 Roh CLA 2009-02-24 03:58:31 EST
(In reply to comment #0)
> If I create a hello world program that includes a standard header, I get
> "Unresolved inclusion" warning mark on it.
> What's the reason that CDT issues a warning even for a standard header such as
> <stdio.h>?
> I understand the warning can be eliminated by adding Include directories under
> "Pasths and Symbols". But I would think /usr/include should be added there by
> default.
> 

I am also facing this issue

Unresolved inclusion: <assert.h> and many other C++ header files please let me know what to do, how to resolve this issue

Thanks
Comment 2 Roh CLA 2009-02-24 04:05:58 EST
(In reply to comment #1)
> (In reply to comment #0)
> > If I create a hello world program that includes a standard header, I get
> > "Unresolved inclusion" warning mark on it.
> > What's the reason that CDT issues a warning even for a standard header such as
> > <stdio.h>?
> > I understand the warning can be eliminated by adding Include directories under
> > "Pasths and Symbols". But I would think /usr/include should be added there by
> > default.
> > 
> 
> I am also facing this issue
> 
> Unresolved inclusion: <assert.h> and many other C++ header files please let me
> know what to do, how to resolve this issue
> 
> Thanks
> 

I am also facing this issue

Unresolved inclusion: <assert.h> and many other C++ header files please let me
know what to do, how to resolve this issue.

I already included \usr\include for every workspace.

c/c++ include path & symbols still the error persists

Thanks
Comment 3 Miwako Tokugawa CLA 2009-03-03 22:01:48 EST
I may have had an unclean environment(?). I'm not seeing this issue with a freshly installed ganymede. I'll let you know if I have a further issue.
Comment 4 Miwako Tokugawa CLA 2009-03-05 17:26:06 EST
I've found that this problem only appears with our integration installed if I have the StandarMakePerFileProfile as part of .c and .cpp tool inputTypes, i.e.
       <tool
            outputFlag="-c -o" ...(etc.etc.)
             <inputType
                sourceContentType="org.eclipse.cdt.core.cSource"
                        sources="c"            scannerConfigDiscoveryProfileId="com.intel.compiler.cdt.managedbuilder.ui.ICCManagedMakePerProjectProfile|com.intel.compiler.cdt.make.core.ICCStandardMakePerFileProfile" .. (etc.etc.)
(or alternatively
scannerConfigDiscoveryProfileId="com.intel.compiler.cdt.make.core.ICCStandardMakePerFileProfile")
I tried with CDT4 and saw the same problem so it's not new to CDT5+.

What I don't understand is that I see that gnu plugin.xml (org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml) virtually the same, i.e.

            <inputType
                sourceContentType="org.eclipse.cdt.core.cSource"
                        sources="c"            
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
..

and CDT doesn't have a problem discoverying include paths.
Comment 5 Miwako Tokugawa CLA 2009-03-05 18:23:06 EST
OK. The problem magically seems to disappear if I use 
scannerConfigDiscoveryProfileId="com.intel.compiler.cdt.managedbuilder.ui.ICCManagedMakePerProjectProfile|com.intel.compiler.cdt.make.core.ICCStandardMakePerFileProfile"
only with cSource and leave it as 
scannerConfigDiscoveryProfileId="com.intel.compiler.cdt.managedbuilder.ui.ICCManagedMakePerProjectProfile"
with cxxSource.
That's what gnu really does.., i.e. it only supports perFile with c projects and not with cpp. 
Now the question is why. I changed the Bugzilla title.
Comment 6 Alex Chapiro CLA 2009-03-06 15:21:11 EST
I think if you are working with multi-language project (C + C++ is one of such cases), only Per Language scope makes sense. This one expect per file scanner profile. What is wrong now is that Discovery dialog offers both. I know aboout that.
About your last comment. Preparing patch we were limited with requirement do not change API. That's why definition of more than oe profile per input done using  such an ugly ay. I'd prefer to change extension point description by adding one more attribute to input descriptor.
And of course it should be documented.
Attached please find an example extracted from our tool chain integration.
Comment 7 Alex Chapiro CLA 2009-03-06 15:22:22 EST
Created attachment 127857 [details]
profile definition example
Comment 8 Doug Schaefer CLA 2009-03-06 15:23:47 EST
The whole scanner discovery system is a mess and is on the top of my list of things to address for CDT 7.
Comment 9 Alex Chapiro CLA 2009-03-06 15:39:11 EST
It would be nice if when somebody fixes this disaster, he/she would also hides UI  in order not to scare or annoy customers. Many complains about that. People don't understand what is it about and why they should see it . The main priority in any design should be an end user, then support service, and developer should be the last. I'm afraid this component is an example of the opposite approach..
Comment 10 Doug Schaefer CLA 2009-03-06 16:05:33 EST
(In reply to comment #9)
> It would be nice if when somebody fixes this disaster, he/she would also hides
> UI  in order not to scare or annoy customers. Many complains about that. People
> don't understand what is it about and why they should see it . The main
> priority in any design should be an end user, then support service, and
> developer should be the last. I'm afraid this component is an example of the
> opposite approach..
> 

Hell, I don't understand it, and I was there :P.
Comment 11 Andrew Gvozdev CLA 2009-09-16 14:17:17 EDT
(In reply to comment #6)
> I think if you are working with multi-language project (C + C++ is one of such
> cases), only Per Language scope makes sense. This one expect per file scanner
> profile. What is wrong now is that Discovery dialog offers both. I know aboout that.

Alex, why do you think that Per Language scope expects "per file" scanner profile? I see in the code that "per project" is also activated just fine (in CommonBuilder.contributeToConsoleParserList()). BTW there is no "Per Language" scope concept in the code other than in UI (at least I did not see one wandering over the code). There is Toolchain.isRcTypeBasedDiscovery flag which is regarded as configuration property. This one is easy to confuse with "per file" but they have no relation AFAICS.

I added both "per project" and "per file" profiles to both UI scopes "Per Language" and "Configuration-wide" as UI scopes are really just different views to choose one "selected" profile. Let me know guys if I got it wrong. I am using deduction method to figure it out and there is much to deduct yet.