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

Compilation: forward clang diagnostics to error bundles #17947

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

jacobly0
Copy link
Member

@jacobly0 jacobly0 commented Nov 9, 2023

zig build-exe repro Debug native: error: the following command failed with 2 compilation errors:
zig build-exe repro/repro.c --cache-dir repro/zig-cache --global-cache-dir ~/.cache/zig --name repro --listen=- 
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install repro transitive failure
   └─ zig build-exe repro Debug native 2 errors
repro/repro.c:6:17: error: invalid operands to binary expression ('float' and 'float')
    float z = x & y;
              ~~^~~
repro/repro.c:7:7: error: passing 'float' to parameter of incompatible type 'void *'
    f(z);
      ^
repro/repro.c:1:14: note: passing argument to parameter 'x' here
void f(void *x) {}
             ^

compared with the original clang diagnostics

repro/repro.c:6:17: error: invalid operands to binary expression ('float' and 'float')
    6 |     float z = x & y;
      |               ~ ^ ~
repro/repro.c:7:7: error: passing 'float' to parameter of incompatible type 'void *'
    7 |     f(z);
      |       ^
repro/repro.c:1:14: note: passing argument to parameter 'x' here
    1 | void f(void *x) {}
      |              ^
2 errors generated.

@xdBronch
Copy link
Contributor

xdBronch commented Nov 9, 2023

do we also get warnings from C code built with build.zig now?

@andrewrk andrewrk merged commit 03adafd into ziglang:master Nov 10, 2023
@jacobly0 jacobly0 deleted the fwd-clang-errs branch November 11, 2023 16:38
jacobly0 added a commit to jacobly0/zig that referenced this pull request May 25, 2024
jacobly0 added a commit to jacobly0/zig that referenced this pull request May 25, 2024
jacobly0 added a commit that referenced this pull request May 26, 2024
Rexicon226 pushed a commit to Rexicon226/zig that referenced this pull request May 29, 2024
Rexicon226 pushed a commit to Rexicon226/zig that referenced this pull request Jun 9, 2024
ryoppippi pushed a commit to ryoppippi/zig that referenced this pull request Jul 5, 2024
SammyJames pushed a commit to SammyJames/zig that referenced this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants