Thiago Adams

Results 89 comments of Thiago Adams

I am afraid this bug is caused by error in pragma once.

The static analyzer consider that functions **don't return uninitialized objects**. ```c struct X* f(); ``` It also consider that if the pointed object exists, it is initialized. The pointer return...

New idea "state cast" ```c struct X * p = _Uninitialized(mymalloc(sz)); struct X * p = _Zeroed(calloc(1, sz)); ```

not the case o malloc, calloc, but the problem is when the meaning is dynamic ```c int main() { mtx_t mtx; if (mtx_init(&mtx, mtx_plain) == thrd_success) { static_set(mtx, "not-null"); mtx_destroy(&mtx);...

For uninitialized _Out could be used then it the same of arguments. ```c _Out void * _Owner malloc(int size); ``` it means the pointed object (whatever it is) is uninitialized....

suggestion..start without -fanalyser. This will ask you to add qualifiers and this is similar of "fixing const" then having 0 warning without -fanalyser you can turn it on. ```c #pragma...

```c #pragma safety enable #include struct Foo { int *_Owner _Opt p; }; void *_Owner _Opt mymalloc(int size) { return malloc(size); } struct Foo *_Owner _Opt foo_new(void) { // change...

One alternative is to convert expressions using operators to function call syntax. For instance the expression ``` a + b * c ``` becomes ``` add(a , mult(b, c)); ```...

C23 included the header ```c bool ckd_add(type1 *result, type2 a, type3 b); bool ckd_sub(type1 *result, type2 a, type3 b); bool ckd_mul(type1 *result, type2 a, type3 b); ```` Maybe cake could...