Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74cea89

Browse filesBrowse files
committed
translate-c: fix not printing clang errors
1 parent 5ebed1c commit 74cea89
Copy full SHA for 74cea89

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Collapse file

‎src/codegen.cpp‎

Copy file name to clipboardExpand all lines: src/codegen.cpp
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5298,18 +5298,19 @@ void codegen_translate_c(CodeGen *g, Buf *full_path) {
52985298

52995299
ZigList<ErrorMsg *> errors = {0};
53005300
int err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr);
5301-
if (err) {
5302-
fprintf(stderr, "unable to parse C file: %s\n", err_str(err));
5303-
exit(1);
5304-
}
53055301

5306-
if (errors.length > 0) {
5302+
if (err == ErrorCCompileErrors && errors.length > 0) {
53075303
for (size_t i = 0; i < errors.length; i += 1) {
53085304
ErrorMsg *err_msg = errors.at(i);
53095305
print_err_msg(err_msg, g->err_color);
53105306
}
53115307
exit(1);
53125308
}
5309+
5310+
if (err) {
5311+
fprintf(stderr, "unable to parse C file: %s\n", err_str(err));
5312+
exit(1);
5313+
}
53135314
}
53145315

53155316
static ImportTableEntry *add_special_code(CodeGen *g, PackageTableEntry *package, const char *basename) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.