Skip to content

mv c/openssl => github.com/llarhub/openssl - #64

Closed
xushiwei wants to merge 2 commits into
goplus:mainfrom
xushiwei:t
Closed

xushiwei wants to merge 2 commits into
goplus:mainfrom
xushiwei:t

Conversation

@xushiwei

Copy link
Copy Markdown
Member

No description provided.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 old Long alias was 32-bit on 64-bit Windows (LLP64), where these C types are 64-bit — a latent truncation hazard. int is the correct width everywhere.
  • IntptrT (uintptr → int): corrects a signedness mismatch — intptr_t is signed, but uintptr is unsigned. Width was already fine.
  • UintptrT / SizeT correctly remain uintptr, 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.

Comment thread c/c.go
type PtrdiffT = Long

type IntptrT = uintptr
type SsizeT = int

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@xushiwei xushiwei closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant