Skip to content

doc: add missing float32/float64 FFI type names - #64874

Open
soulee-dev wants to merge 1 commit into
nodejs:mainfrom
soulee-dev:doc-ffi-float-type-names
Open

doc: add missing float32/float64 FFI type names#64874
soulee-dev wants to merge 1 commit into
nodejs:mainfrom
soulee-dev:doc-ffi-float-type-names

Conversation

@soulee-dev

Copy link
Copy Markdown
Contributor

ToFFIType() accepts float32 and float64 as aliases for float and double, but the supported type names list never included them. They were added to the parser in #62892, which only touched src/ffi/types.cc, so the same section lists both as ffi.types constant values a few lines below a list that omits them.

Also splits char onto its own line. u8, uint8 and bool always map to ffi_type_uint8, whereas char maps to ffi_type_sint8 or ffi_type_uint8 depending on the platform, as the paragraph below the list already documents.

#64848 proposes removing these aliases entirely; this only makes the list match what ToFFIType() accepts today, and those lines can go away with the aliases if that lands.

Refs: #62892
Refs: #64848

`ToFFIType()` accepts `float32` and `float64` as aliases for `float`
and `double`, and both names already appear in the `ffi.types`
constants list further down the same page, but they were missing from
the list of supported type names.

Also split `char` onto its own line. Unlike `u8`, `uint8` and `bool`,
which always map to `ffi_type_uint8`, `char` maps to either
`ffi_type_sint8` or `ffi_type_uint8` depending on the platform C ABI,
as the paragraph below the list already explains.

Signed-off-by: Soul Lee <alus20x@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. ffi Issues and PRs related to experimental Foreign Function Interface support. labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. ffi Issues and PRs related to experimental Foreign Function Interface support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants