zig icon indicating copy to clipboard operation
zig copied to clipboard

Compiler errors in std pt. 2

Open PauloCampana opened this issue 1 year ago • 2 comments

Similar to #20505, all of these are compiler errors

Commented lines have been fixed by #21138 #21240 #21181

const std = @import("std");

test {
    // _ = &std.debug.dumpStackPointerAddr; // missing {s} format

    // windows
    _ = &std.os.windows.sendmsg; // wrong type
    _ = &std.fs.File.tryLock; // returning void instead of bool
    _ = &std.debug.SelfInfo.Module.getDwarfInfoForAddress; // no such field debug_data

    // _ = &std.os.linux.BPF.btf.IntInfo; // invalid packed struct
    // _ = &std.os.linux.futex2_wake; // illegal [*]anyopaque
    // _ = &std.os.linux.futex2_wait; // missing intfromenum
    // _ = &std.os.linux.futex2_waitv;
    // _ = &std.os.linux.VFS_CAP_FLAGS_MASK; // ~ on comptime_int
    // _ = &std.os.linux.vfs_cap_data; // invalid extern stuct
    // _ = &std.os.linux.sendmmsg; // wrong type and field names
    // _ = &std.os.linux.sigismember; // bit shift with wrong type

    // haiku
    _ = &std.c._kern_get_current_team; // got deleted?
    _ = &std.c._kern_open_dir;
    _ = &std.c._kern_read_dir;
    _ = &std.c._kern_read_stat;
    _ = &std.c._kern_rewind_dir;
    _ = &std.c.vregs;

    // darwin
    // _ = &std.c.THREAD_STATE_NONE; // switch missing else
    _ = &std.c.EXC.MASK; // invalid packed struct
    _ = &std.c.sigaddset; // typo in segset_t
    _ = &std.c.os_log_create; // extern fn with opaque
    _ = &std.c.os_log_type_enabled;
    _ = &std.c.os_signpost_enabled;
    _ = &std.c.os_signpost_id_generate;
    _ = &std.c.os_signpost_id_make_with_pointer;
    _ = &std.c.os_signpost_interval_begin;
    _ = &std.c.os_signpost_interval_end;
    _ = &std.c.NOTE.PCTRLMASK; // ~ on comptime_int

    _ = &std.posix.timestamp_t; // doesnt exist inside `system.` but `std.os.wasi.`

    // on systems where usize != u64
    _ = &std.Build.Fuzz.WebServer.coverageRun;
    _ = &std.Build.Fuzz.WebServer.run;
}

PauloCampana avatar Aug 16 '24 06:08 PauloCampana

https://github.com/ziglang/zig/pull/21138 fixes the std.os.linux part

fardragon avatar Aug 23 '24 20:08 fardragon

_ = &std.c._kern_get_current_team; // got deleted?

Regressed in #20679, see lib/std/c/haiku.zig:1389 (link does not work because large diff is not rendered).

@andrewrk should that part be deleted entirely or restored?

sfiedler0 avatar Oct 11 '24 12:10 sfiedler0