Skip to content

Layout of char #101

Open
Open
@gnzlbg

Description

@gnzlbg

Currently we only say that char has size 4. Is there anything we can say about its alignment beyond "implementation-defined" ?

Also @ubsan mentioned:

I'd argue it'd be useful to be ABI compatible with char32_t) (note: that type only exists in C++).

People have argued that they shouldn't be ABI compatible, since char32_t doesn't have the correctness guarantees Rust's char does; I would argue that it's the same idea as C-like enums in Rust vs enums in C++.

This question is still unresolved.


We probably also want to mention whether on all currently supported platforms the ABI of char is INTEGER or AGGREGATE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layoutTopic: Related to data structure layout (`#[repr]`)C-open-questionCategory: An open question that we should revisitS-not-opsemDespite being in this repo, this is not primarily a T-opsem question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions