Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

cCharSignedness

Public Function
std.Target.cCharSignedness
pub fn cCharSignedness(target: *const Target) ?std.builtin.Signedness

Default signedness of char for the native C compiler for this target Note that char signedness is implementation-defined and many compilers provide an option to override the default signedness e.g. GCC's -funsigned-char / -fsigned-char Returns null if no C ABI is defined for this target.

Params

File

Target.zig:3151
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
pub fn cCharSignedness(target: *const Target) ?std.builtin.Signedness {
    switch (target.os.tag) {
        .opengl => return null,
        else => {},
    }
    if (target.os.tag.isDarwin() or target.os.tag == .windows or target.os.tag == .uefi) return .signed;
    return switch (target.cpu.arch) {
        .aarch64,
        .aarch64_be,
        .arm,
        .armeb,
        .arc,
        .arceb,
        .csky,
        .ez80,
        .hexagon,
        .msp430,
        .powerpc,
        .powerpcle,
        .powerpc64,
        .powerpc64le,
        .s390x,
        .riscv32,
        .riscv32be,
        .riscv64,
        .riscv64be,
        .thumb,
        .thumbeb,
        .xcore,
        .xtensa,
        .xtensaeb,
        => .unsigned,
        else => .signed,
    };
}