typedef void汇编误差(是初始化的(使用dectType))

typedef void compilation error (is initialized (use decltype instead))

本文关键字:dectType 初始化 使用 void 汇编 误差 typedef      更新时间:2023-10-16

我正在尝试使用一些struct s编译简单的标头,但我遇到了此错误:

ppal.h:25:34: error: typedef ‘string_proc_func’ is initialized (use decltype instead)
typedef void (*string_proc_func)(string_proc_key*);

还有很多其他错误,但我认为这是导致其他错误的错误。我的标题看起来像这样:

#include <stdint.h>
using namespace std;
typedef struct string_proc_list_t
{
    char* name;
    struct string_proc_node_t* first;
    struct string_proc_node_t* last;
} __attribute__((__packed__)) string_proc_list;

typedef struct string_proc_node_t
{
    struct string_proc_node_t* next;
    struct string_proc_node_t* previous;
    string_proc_func f;
    string_proc_func g;
    string_proc_func_type type;
} __attribute__((__packed__)) string_proc_node;
typedef void (*string_proc_func)(string_proc_key*);
typedef enum string_proc_func_type_t
{
    REVERSIBLE = 0,
    IRREVERSIBLE = 1
} __attribute__((__packed__)) string_proc_func_type;
typedef struct string_proc_key_t
{
    uint32_t length;
    char* value;
} __attribute__((__packed__)) string_proc_key;

我寻找类似的问题,但找不到解决方法。

您要在声明之前尝试使用string_proc_key

typedef struct ... string_proc_key;

下方的错误移动线路