-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type Struct (unnamed at /usr/local/...) #66
Comments
相同的问题出现在 typedef struct {
/**
* \brief Filter ID
*
* Use constants whose name begin with 'LZMA_FILTER_' to specify
* different filters. In an array of lzma_filter structures, use
* LZMA_VLI_UNKNOWN to indicate end of filters.
*
* \note This is not an enum, because on some systems enums
* cannot be 64-bit.
*/
lzma_vli id;
/**
* \brief Pointer to filter-specific options structure
*
* If the filter doesn't need options, set this to NULL. If id is
* set to LZMA_VLI_UNKNOWN, options is ignored, and thus
* doesn't need be initialized.
*/
void *options;
} lzma_filter; 这里的Typedef额外的匿名类型没有正确的被移除 type Struct (unnamed at /opt/homebrew/Cellar/xz/5.6.3/include/lzma/filter.h:41:9) struct {
Id c.Int
Options unsafe.Pointer
}
type LzmaFilter struct {
Id c.Int
Options unsafe.Pointer
} 但是对于typedef一个匿名类型的情况,在llcppsigfetch的测试用例中是能正确表达的,没有出现unnamed的情况 llcppg/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/typedef.go Lines 28 to 30 in 63cdaab
llcppg/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect Lines 475 to 519 in 63cdaab
使用出现问题的源代码,可以复现 llcppsigfetch -temp=true --extract " typedef struct {
lzma_vli id;
void *options;
} lzma_filter;" got
|
在这个用例的上下文中 lzma_vli 是还未定义的,typedef 一个匿名结构体,如果成员中某个类型是还没定义的,对应的Typedecl的Name就会是 (unnamed struct at temp.h:1:19),只要每个类型成员完成了定义,那就不会出现这个预期之外的匿名类型了。
got
|
llcppcfg 生成的默认头文件顺序导致了,在提取ast信息时,先提取了
在原始头文件中也提到,
顺序修改为如下,即可正常转换
|
llcppgtest msgpack-c
llcppgtest mpfr
The text was updated successfully, but these errors were encountered: