Empty structure in C

后端 未结 7 1032
臣服心动
臣服心动 2020-12-01 14:49

I have a structure with no members (for the moment) and I would like to know if it is possible to suppress the warning I get:

warning: struct has no members         


        
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 14:53

    if you just need the struct symbol for casting and function arguments then just:

    typedef struct _Interface Interface;
    

    this will create the symbol for an opaque type.

提交回复
热议问题