Several fixes for the compiler (#2422)

* Update .gitignore for nix

* Fix build failure when compiling with -Werror=maybe-uninitialized

* Fix test failure formatting

* Add separateDebugInfo to c3c Nix build
This commit is contained in:
vssukharev
2025-08-20 22:47:22 +03:00
committed by GitHub
parent 28ffb864a3
commit b7c9a4e2e9
4 changed files with 10 additions and 6 deletions

6
.gitignore vendored
View File

@@ -80,8 +80,10 @@ TAGS
/.cache/
/compile_commands.json
# 'nix build' resulting symlink
# Nix
result
/.envrc
/.direnv/
# macOS
.DS_Store
@@ -89,4 +91,4 @@ result
# tests
/test/tmp/*
/test/testrun
/test/test_suite_runner
/test/test_suite_runner

View File

@@ -140,7 +140,6 @@ fn void unmute_output(bool has_error) @local
usz log_size = test_context.fake_stdout.seek(0, Seek.CURSOR)!!;
if (has_error)
{
io::printf("\nTesting %s ", test_context.current_test_name);
io::printn(test_context.has_ansi_codes ? "[\e[0;31mFAIL\e[0m]" : "[FAIL]");
}

View File

@@ -26,7 +26,10 @@ in llvmPackages.stdenv.mkDerivation (_:
removeSuffix "\"" ( removePrefix "\"" ( elemAt ( splitString " " foundLine ) 2 ) );
src = ../.;
# See https://github.com/symphorien/nixseparatedebuginfod for usage
separateDebugInfo = true;
# Here we substitute GIT_HASH which is not set for cmake in nix builds.
# Similar situation is with __DATE__ and __TIME__ macros, which are
# set to "Jan 01 1980 00:00:00" by default.

View File

@@ -2643,8 +2643,8 @@ static void llvm_emit_slice_values(GenContext *c, Expr *slice, BEValue *parent_r
BEValue parent_addr_x;
llvm_emit_expr(c, &parent_addr_x, parent_expr);
LLVMValueRef parent_load_value = NULL;
LLVMValueRef parent_base;
LLVMValueRef parent_addr;
LLVMValueRef parent_base = NULL;
LLVMValueRef parent_addr = NULL;
if (parent_type->type_kind == TYPE_POINTER)
{
llvm_value_rvalue(c, &parent_addr_x);