Error while doing static analysis: Include file does not match processor setting

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.

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?

Thanks & Regards,

Snehal Sable

CBA | Productivity & FE | Board: +91-20-66525000 Ext: 3228 | Cell: 9096885853|KPIT Cummins Infosystems Ltd, Pune

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