Fix error maybe-uninitialized (#2230)

* Add build instructions for Arch Linux

* Fix error maybe-uninitialized in llvm_codegen_expr.c when compiling with clang 20.1.6
This commit is contained in:
Estanislao Pérez Nartallo
2025-06-20 00:55:06 +02:00
committed by GitHub
parent 8d698b5e40
commit 2e42868467
2 changed files with 2 additions and 3 deletions

View File

@@ -379,8 +379,7 @@ The c3c binary should be created in the build directory. You can try it out by r
```bash
cmake -B build \
-D C3_LINK_DYNAMIC=ON \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_FLAGS_RELEASE="-Wno-error=maybe-uninitialized"
-D CMAKE_BUILD_TYPE=Release
```
5. Build the project: `make -C build`.

View File

@@ -2051,7 +2051,7 @@ static inline LLVMValueRef llvm_emit_inc_dec_value(GenContext *c, SourceSpan spa
Type *element = type_lowering(type->array.base);
LLVMValueRef diff_value;
bool is_integer = type_kind_is_any_integer(element->type_kind);
bool is_ptr;
bool is_ptr = false;
if (is_integer)
{
diff_value = LLVMConstInt(llvm_get_type(c, element), 1, false);