Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-lib with emit-h is crashing for particular input file #22405

Open
arkadiuszwojcik opened this issue Jan 4, 2025 · 0 comments
Open

build-lib with emit-h is crashing for particular input file #22405

arkadiuszwojcik opened this issue Jan 4, 2025 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@arkadiuszwojcik
Copy link

Zig Version

0.13.0

Steps to Reproduce and Observed Behavior

I have simple test.zig file and would like to export (emit H file) following function:

const std = @import("std");

export fn memset(dest: [*]u8, ch: c_int, count: usize) [*]u8 {
    @memset(dest[0..count], @intCast(ch));
    return dest;
}

I am using following command:
zig build-lib -ODebug -Mroot=D:\test\test.zig -femit-h

The process is crashing? (console output is strange) and doesn't emit H file. No error is displayed. I am using Windows machine.

When I try same command but without -femit-h then everyting is working (zig lib is generated):
zig build-lib -ODebug -Mroot=D:\test\test.zig

When I use -femit-h for simpler test.zig it works fine and H file is generated. Example test.zig that works fine:

const std = @import("std");

export fn my_max(a: u32, b: u32) u32 {
    return @max(a, b);
}

export fn my_min(a: u32, b: u32) u32 {
    return @min(a, b);
}

Expected Behavior

H file should be emited or minigful error (if not possible) should be displayed

@arkadiuszwojcik arkadiuszwojcik added the bug Observed behavior contradicts documented or intended behavior label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant