Eclipse CDT shows semantic errors, but compilation is ok

后端 未结 20 1447
青春惊慌失措
青春惊慌失措 2020-12-01 07:42

I have installed Eclipse Indigo for C/C++ Linux developers on Ubuntu 10.04 x86.

When I use common predefined macro __BASE_FILE__ Eclipse says Sym

20条回答
  •  星月不相逢
    2020-12-01 08:02

    I have the same problem. Compiler preprocesses ok, but static analyzer doesn't. In my source file:

    #define PLATFORM_INC_FILES
    #include 
    
    int coflags=O_BINARY; // Undefined symbol
    

    In platform.h (an OS dependent header to help creating portable code):

    #ifdef PLATFORM_INC_FILES
        #include 
        ...
    

    It looks like static analyzer doesn't take the .c #define statements into account when preprocessing included headers. By defining it at the symbols dialog, errors dissapear, but that is a project scope symbol definition, resulting in every source to include every system header in my case.

    Hope it gets fixed soon...

    Using Eclipse Mars and MinGW on MSIS2.

提交回复
热议问题