函数声明中的参数名称(无类型)(循环引用)
parameter names (without types) in function declaration (Circular reference)
如何修复此警告?
typedef void (*VF_A)(PST_A); // Warning here: parameter names (without types) in function declaration
typedef struct ST_A_ {
...
VF_A vf_a;
} ST_A, *PST_A;
这个问题类似于Resolve circular typedef dependency?, but yours is slightly different in that you have a pointer to a function instead of a struct. Use the strategy from this answer。
问题背后的想法是您试图声明一个新类型并同时定义一个结构。解决方法是把这两个分开:
typedef struct ST_A_ ST_A, *PST_A; // PST_A points to some struct, defined later
typedef void (*VF_A)(PST_A); // use PST_A to define VF_A
struct ST_A_ { VF_A vf_a; }; // now define the struct PST_A points to
如何修复此警告?
typedef void (*VF_A)(PST_A); // Warning here: parameter names (without types) in function declaration
typedef struct ST_A_ {
...
VF_A vf_a;
} ST_A, *PST_A;
这个问题类似于Resolve circular typedef dependency?, but yours is slightly different in that you have a pointer to a function instead of a struct. Use the strategy from this answer。
问题背后的想法是您试图声明一个新类型并同时定义一个结构。解决方法是把这两个分开:
typedef struct ST_A_ ST_A, *PST_A; // PST_A points to some struct, defined later
typedef void (*VF_A)(PST_A); // use PST_A to define VF_A
struct ST_A_ { VF_A vf_a; }; // now define the struct PST_A points to