[cfe-dev] Error while doing static analysis: Include file does not match processor setting

Eli Friedman eli.friedman at gmail.com
Thu Jun 6 08:00:31 PDT 2013


On Thu, Jun 6, 2013 at 2:31 AM, Snehal Sable
<Snehal.Sable at kpitcummins.com>wrote:

>  Hi,   ****
>
> ** **
>
> I am using clang tool for static analysis of my code which is compliable
> using MPLAB compiler. ****
>
> Here it is giving error ā€œ*Include file does not match processor setting*ā€
> error and so it is not doing further analysis.
>

A quick bit of searching shows that this isn't a clang error, but rather a
"#error" directive coming out of your source code.  In the future, please
provide the exact diagnostic output from clang.


> ****
>
> I need to add the complier name using the target variable, can it be done
> using ā€œ-dā€ as in GCC Compiler.****
>
> Is there any other way so that it can be done in clang or is there any
>  flag in option.td file to be set for getting this issue resolved?
>

clang supports -D just like gcc.

Note that you're likely to run into other issues: if your code is intended
for an embedded target, you want to specify that with -target, and properly
adding a target to clang requires hacking the compiler.  Otherwise, the
compiler will get confused about things like the size of "int".  (See
clang/lib/Basic/Targets.cpp).

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130606/d40b51b4/attachment.html>


More information about the cfe-dev mailing list