Zig 0.17.0-dev (Split by item)

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 library itself.

cCharSignedness

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

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

File

lib/std/Target.zig:3069

Code

pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
    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,
    };
}