#include <pthread.h> #include <stdlib.h> struct log { int bob; pthread_mutex_t x; }; void m_init(pthread_mutex_t *x); struct log *f() { struct log x, *y; y = (struct log *) malloc(sizeof(struct log)); x.bob = 3; *y = x; pthread_mutex_init(&y->x, NULL); //m_init(&y->x); return y; }
err:
Checking /tmp/s.c ... /tmp/s.c:17:7: error: Uninitialized variable: x.x [uninitvar] *y = x; ^ /tmp/s.c:17:7: error: Uninitialized struct member: x.x [uninitStructMember] *y = x; ^
Log in to post a comment.
err: