c++ - Clang Diagnostics, how to ignore compiler specific extensions -


my production code compiled on proprietary compiler language extensions, example:

__even_in_range(ta2iv, ta2iv_taifg); 

but using clang code analysis tool, , getting error error: use of undeclared identifier '__even_in_range'. there few more language extensions produce similar behavior. there way ask clang ignore identifiers?

edit: both of comments guided me towards define solution, added these compiler options code analysis package ( use https://github.com/lvzixun/clang-complete package).

  1. -d __even_in_range(y,x)=y
  2. -d __interrupt=

this way none of sources influenced static analysis tool

thanks...

you can use predefined macro __clang_analyzer__ identify analyzer being run, , #define out extensions in case:

#ifdef __clang_analyzer__ #define __even_in_range(...) ... #endif 

details here, along other ideas rid of false positives.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -