[cfe-dev] Disable #error?

Justin Bogner mail at justinbogner.com
Fri Jan 24 17:55:00 PST 2014


Jacob Carlborg <doob at me.com> writes:
> On 2014-01-23 21:11, Sean Silva wrote:
>
>> There is no main_preprocessed.h as far as clang is concerned (unless you
>> manually create it, but then clang leaves #line's to keep track of where
>> things are from).
>
> I was just for illustration.
>
>> If you look at the SourceLocation for `struct List`, it will tell you
>> that the declaration is in
>> `/home/foo/libcollection/__include/collection/list/list.h`.
>
> I seem to have very hard time to explain myself here. Perhaps I'm
> missing something obvious here but how do I know that
> "/home/foo/libcollection/include/collection/list/list.h" is not in the
> in the "/home/foo/libmain" path?

Could you do something like:

1. Make a list of the headers you're interested in processing (you
   probably already do this).

2. Make a list of the "umbrella" headers that you'll process. This
   may be implicit, by abandoning processing when you try to process
   something that needs to be included by an umbrella or whatever.

3. Process the umbrella headers, but look up the source location in your
   list of interesting headers from (1) to decide where the information
   comes from.



More information about the cfe-dev mailing list