DoxigAlpha

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

Function parameters

Parameters

#
target:*const Target

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
requiresLibC
Does this target require linking libc? This may be the case if the target has an unstable
cCharSignedness
Default signedness of `char` for the native C compiler for this target

Source

Implementation

#
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) {
        .arm,
        .armeb,
        .thumb,
        .thumbeb,
        .aarch64,
        .aarch64_be,
        .arc,
        .csky,
        .hexagon,
        .msp430,
        .powerpc,
        .powerpcle,
        .powerpc64,
        .powerpc64le,
        .s390x,
        .riscv32,
        .riscv64,
        .xcore,
        .xtensa,
        => .unsigned,
        else => .signed,
    };
}