-
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
gogensig: panic: underlying type must not be nil #61
Comments
gnutls 问题是来自于typdef 一个枚举类型导致的panic 2024/12/24 09:17:55 NewFuncDecl: &{pwritev} is a function of system header file
2024/12/24 09:17:55 SetCurFile: compat.go File in Current Package: true
2024/12/24 09:17:55 NewTypedefDecl: &{gnutls_connection_end_t}
2024/12/24 09:17:55 NewTypedefDecl: &{gnutls_cipher_algorithm}
panic: underlying type must not be nil
goroutine 1 [running]:
go/types.(*Named).SetUnderlying(0x1400816bab0, {0x0, 0x0})
/Users/zhangzhiyang/golang/go1.20.4/src/go/types/named.go:435 +0xf4
github.com/goplus/gogen.(*TypeDecl).InitType(0x1400fc4b9a0, 0x140000ca540, {0x102c469c0?, 0x1400816bb20?}, {0x0, 0x0, 0x0})
/Users/zhangzhiyang/go/pkg/mod/github.com/goplus/[email protected]/type_var_and_const.go:114 +0x1b0 typedef enum gnutls_cipher_algorithm {
GNUTLS_CIPHER_UNKNOWN = 0,
GNUTLS_CIPHER_NULL = 1,
GNUTLS_CIPHER_ARCFOUR_128 = 2,
GNUTLS_CIPHER_3DES_CBC = 3,
GNUTLS_CIPHER_AES_128_CBC = 4,
GNUTLS_CIPHER_AES_256_CBC = 5,
GNUTLS_CIPHER_ARCFOUR_40 = 6,
} gnutls_cipher_algorithm_t;
typedef enum {
GNUTLS_KX_UNKNOWN = 0,
GNUTLS_KX_RSA = 1,
GNUTLS_KX_DHE_DSS = 2,
GNUTLS_KX_DHE_RSA = 3,
GNUTLS_KX_ANON_DH = 4,
GNUTLS_KX_SRP = 5,
GNUTLS_KX_RSA_EXPORT = 6,
GNUTLS_KX_SRP_RSA = 7,
GNUTLS_KX_SRP_DSS = 8,
GNUTLS_KX_PSK = 9,
GNUTLS_KX_DHE_PSK = 10,
GNUTLS_KX_ANON_ECDH = 11,
GNUTLS_KX_ECDHE_RSA = 12,
GNUTLS_KX_ECDHE_ECDSA = 13,
GNUTLS_KX_ECDHE_PSK = 14,
GNUTLS_KX_RSA_PSK = 15,
GNUTLS_KX_VKO_GOST_12 = 16
} gnutls_kx_algorithm_t; llcppg.cfg
经过调查,发现是因为在gnutls/gnutls.h的底部,才引入<gnutls/compat.h>,而目前的处理逻辑是,对于一个头文件,先处理其include列表,处理结束后,才会处理本来的头文件,这就导致了gogensig 先处理gnutls/compat.h 的时候,gnutls_cipher_algorithm_t这个类型还没定义 gnutls/gnutls.h
gnutls/compat.h
|
bdw-gc redeclared 的问题也是因为目前gogensig的include处理逻辑为直接根据include决定转换顺序导致的,与gnutls的原因一致https://github.com/goplus/llcppg/issues/61#issuecomment-2560509332,目前的逻辑导致先转换了 cord_pos.h ,而后再转换cord.h,这导致了cord_pos 使用类型CORD时,还并不存在这个类型。
related llcppg.cfg
|
python-3.12-embed 相同的问题,先处理了
|
openssl, libssl, libcrypto same question
struct conf_st;
struct conf_method_st;
typedef struct conf_method_st CONF_METHOD;
# include <openssl/conftypes.h>
|
libbzstd 的问题已在latest llcppg 中被修复 |
llcppgtest gnutls
llcppgtest gnutls-dane
llcppgtest libzstd
llcppgtest openssl
The text was updated successfully, but these errors were encountered: