Repository navigation
Conversation
There was a problem hiding this comment.
This is a clean, well-targeted PR with two changes: (1) removing the c/openssl package (relocated to a separate repo) and (2) retargeting three C-interop type aliases in c/c.go to int.
The type-alias changes are correct — and fix latent bugs. ssize_t, ptrdiff_t, and intptr_t are all signed, pointer-width C types, and Go/LLGo int is signed and pointer-width on every supported target (ILP32 / LP64 / LLP64):
SsizeT/PtrdiffT(Long→int): the oldLongalias was 32-bit on 64-bit Windows (LLP64), where these C types are 64-bit — a latent truncation hazard.intis the correct width everywhere.IntptrT(uintptr→int): corrects a signedness mismatch —intptr_tis signed, butuintptris unsigned. Width was already fine.UintptrT/SizeTcorrectly remainuintptr, forming proper width-matched signed/unsigned pairs.
Removal is clean: no remaining references to openssl anywhere in the tree, the directory is fully gone, and c/llcppg.pub name mappings stay accurate (the Go-side names are unchanged). No in-repo call sites use these aliases, so there is no local compile break.
No performance or security concerns. One minor, non-blocking suggestion inline.
| type PtrdiffT = Long | ||
|
|
||
| type IntptrT = uintptr | ||
| type SsizeT = int |
There was a problem hiding this comment.
[P3] Add a rationale comment for the int-typed aliases
These three aliases now map to Go int (pointer-width signed) rather than Long, but sit directly beside the detailed platform-sizing comment for Long/Ulong above (lines 42-46). Without a note, a future contributor may "helpfully" revert them to Long to match the surrounding IntmaxT = LongLong styling — reintroducing the 64-bit Windows (LLP64) truncation bug this change fixes.
Consider a one-line comment explaining the intent, e.g.:
// ssize_t/ptrdiff_t/intptr_t are signed pointer-width types;
// map to Go int (pointer-width), NOT C long.
type SsizeT = int
type PtrdiffT = int
type IntptrT = int
No description provided.