more fixes and checked clang++ build for generics
This commit is contained in:
parent
9e642f9ed4
commit
53e4cb652f
@ -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;
|
||||||
|
2
makefile
2
makefile
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user