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

missing compile error, code generates invalid llvm IR instead #601

Closed
andrewrk opened this Issue Nov 9, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Nov 9, 2017

const c = @cImport(@cInclude("stdio.h"));
pub fn main() -> %void {
    c.printf("hello\n");
}

output:

$ zig build-exe test.zig --library c
Call parameter type does not match function signature!
[6 x i8]* @35
 i8*  %0 = call i32 (i8*, ...) @printf([6 x i8]* @35), !dbg !498
LLVM ERROR: Broken module found, compilation aborted!

instead should be something like:

/home/andy/tmp/test.zig:2:9: error: expected type '?&const u8', found '[5]u8'
    foo("hello");
        ^

@andrewrk andrewrk added the bug label Nov 9, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Nov 9, 2017

@andrewrk andrewrk closed this in 7ea669e Nov 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment