more fixes and checked clang++ build for generics

This commit is contained in:
Richard Thier 2025-04-25 03:35:27 +02:00
parent 9e642f9ed4
commit 53e4cb652f
2 changed files with 3 additions and 3 deletions

View File

@ -15,11 +15,11 @@ int main() {
// printf("vektor.count:%d\n", data.count); // printf("vektor.count:%d\n", data.count);
for(int i = 0; i < data.count; ++i) { for(int i = 0; i < data.count; ++i) {
scanf(" %d", &n); scanf(" %zu", &n);
data.v[i] = n; data.v[i] = n;
} }
n = 0; for(int i = 0; i < data.count; ++i) n += data.v[i]; n = 0; for(int i = 0; i < data.count; ++i) n += data.v[i];
printf("Sum: %d\n", n); printf("Sum: %zu\n", n);
// RAII releases array here automagicaly! // RAII releases array here automagicaly!
return 0; return 0;

View File

@ -37,6 +37,6 @@ clang:
clang construct_destruct.c -o construct_destruct clang construct_destruct.c -o construct_destruct
# clang raii_test.c -o raii_test # should not work # clang raii_test.c -o raii_test # should not work
clang++ raii_test.cpp -o raii_test_cpp clang++ raii_test.cpp -o raii_test_cpp
clang++ array_handle_gen_test.c -o array_handle_gen_test_cpp clang++ array_handle_gen_test.c -o array_handle_gen_test_clangpp
expand: expand:
gcc -E handle_test.c -o handle_test_expanded.c gcc -E handle_test.c -o handle_test_expanded.c