Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@NotsoanoNimus
Copy link
Contributor

There are countless places where the pattern $sizeof(something) * 8 is used to express the conversion of a type's byte-width to bits.

Most languages usually have a flavor of this macro in order to make conversions readily apparent and readable by maintainers.

More unit tests are welcome for corner cases, but it's rather straightforward.

@lerno
Copy link
Collaborator

lerno commented Aug 6, 2025

Looks good. Add something in the releasenotes for it.

@lerno
Copy link
Collaborator

lerno commented Aug 6, 2025

Multiplying by "8" will make it signed, so I switched to 8u and also set the type of the macro, so that it's clear what the return type is.

@lerno lerno merged commit aae873c into c3lang:master Aug 6, 2025
43 checks passed
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.

2 participants