Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to get CDT parser to search -I includes beforedefault includes

Mikhail,

Hi Jason,

User-defined includes and macros are always appended to the built-in
includes in MBS and you can not change this behavior for now.

Thanks for the clarification.

Is this true for all tools that user-defined paths are searched first?


I have no definitive answer, but it ought to be the case otherwise you will never be able to override system .h files without changing all your code includes. This could be potential nightmare.

If so I can change the MBS Path calculation mechanism to add
user-defined includes/macros first to the list.


Since I don't have a definitive answer it is hard to tell, but in my experience this would be the most sensible solution. It turns out that the CDT parser actually doesn't care too much since there the #define evaluator is incorrect and hence it means that the CDT often doesn't get the correct declarations. I have bug fixes for this that I will submit as a patch soon. Since I care a lot that the CDT "sees" the correct declarations I would really appreciate the local includes being ahead of system includes.

As was mentioned in the
https://bugs.eclipse.org/bugs/show_bug.cgi?id=107952#c4, in the future
we're going to implement a smart MBS-generic external scanner info
provider that'll be able to calculate the precise set and order of
includes/macros used by the tool given the environment and user- defined
option values.


I supposed that this was available already since there is an extended scanner class that enables one to build a scanner with two include lists (system, local) and a macro list. So it would be great and a more general solution to the above.

Thanks again for the help, I'll stop smashing my head against the wall.

Jason


Mikhail

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Jason Brown
Sent: Tuesday, May 23, 2006 8:16 PM
To: CDT General developers list.
Subject: [cdt-dev] How to get CDT parser to search -I includes
beforedefault includes

Hi All,

Although I have followed the discussion relating to setting options
in managed projects for adding include paths I couldn't figure out
how to solve the following related problem.

I want user defined include paths (i.e., those added with -I by
adding a path in tool build configuration) to come before the default
set of include paths.  Currently the CDT parser always adds the -I
paths afterwards.

I can easily get all of the include paths for a specific resource
from the getScannerInfoProvider(file).getIncludePaths(), however it
is impossible to understand which are specified by -I and which by
default.

I've tried, but unsuccessfully, to get the paths via the options of a
managed project.

So, can anyone please help me either

i) determine how each include path was specified (i.e., is default or
via -I) so that I can reorder them myself or
ii) explain how to make the -I paths always come before the default
paths when using the CDT parser.

Clear this is not a problem for the target tools as they search -I
include paths before default paths.

Any help is very much appreciated.

Jason

		
___________________________________________________________
Try the all-new Yahoo! Mail. "The New Version is radically easier to
use" - The Wall Street Journal
http://uk.docs.yahoo.com/nowyoucan.html
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


	
	
		
___________________________________________________________ All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine http://uk.docs.yahoo.com/nowyoucan.html


Back to the top