Why does Eclipse CDT say: 'syntax error', but compilation no problem

前端 未结 10 1460
庸人自扰
庸人自扰 2021-02-04 08:04

I am working in existing C code which has a couple of lines with statements similar to this one:

struct collect_conn *tc = (struct collect_conn *) 
     ((char *         


        
10条回答
  •  滥情空心
    2021-02-04 08:45

    It might be confused, check if you have a definition of offsetof in-scope, for instance. Otherwise you might try simplifying the expression, breaking it up using e.g. a #define with the offset of, or something.

    I'm thinking the compiler might provide a built-in version of offsetof, while Eclipses's compiler/code-parser might not. If so, you would need to make sure you have the definition, for Eclipse to be able to properly parse your code.

提交回复
热议问题