Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Handling of PCH / forced includes by indexer

On Mon, Feb 13, 2012 at 02:56:58PM -0800, Sergey Prigogin wrote:
> > But my case is a bit different. For example if I've followed c++ file:
> >
> >        #include <iostream>
> >
> >        int main()
> >        {
> >                my_log("Hello world!");
> >                return 0;
> >        }
> >
> > It definitely will not be compiled/parsed since my_log() function is not
> > defined.
> >
> > But if I try to compile it using followed command-line call:
> >
> >        gcc -include my_globals.h main.cpp
> >
> 
> What prevents you from adding #include "my_globals.h" to main.cpp?
> 

Well, there are multiple issues. Firstly on Mac, Xcode uses -include for
precompiled headers, so a lot of developers just don't add #include for
them. Also for huge codebase modifying all source files is painful.

-- 
WBR, Dmitry


Back to the top