Skip to content

invalid clockid default in std.os.linux #20810

@mkrishnam18

Description

@mkrishnam18

Zig Version

0.14.0-dev.591+1c35e73b6

Steps to Reproduce and Observed Behavior

compile the project with the latest zig version.

https://github.com/andrewrk/poop/
cd poop
zig build. 

it errors out with


std/os/linux.zig:7178:26: error: expected type 'os.linux.clockid_t', found 'comptime_int'
    clockid: clockid_t = 0,
                         ^
std/os/linux.zig:4058:23: note: enum declared here
pub const clockid_t = enum(u32) {
                      ^~~~

Changing clockid:clockid_t=0 to clockid:clockid_t=.REALTIME fixes this.

Expected Behavior

Expected the program to compile and run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorregressionIt worked in a previous version of Zig, but stopped working.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions