Including stdlib.h and stdio.h is required in some configurations: ../src/util/anon_file.c: In function ‘create_tmpfile_cloexec’: ../src/util/anon_file.c:75:9: error: implicit declaration of function ‘mkostemp’ [-Werror=implicit-function-declaration] fd = mkostemp(tmpname, O_CLOEXEC); ^~~~~~~~ ../src/util/anon_file.c: In function ‘os_create_anonymous_file’: ../src/util/anon_file.c:126:11: error: implicit declaration of function ‘getenv’ [-Werror=implicit-function-declaration] path = getenv("XDG_RUNTIME_DIR"); ^~~~~~ ../src/util/anon_file.c:126:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] path = getenv("XDG_RUNTIME_DIR"); ^ ../src/util/anon_file.c:133:7: error: implicit declaration of function ‘asprintf’ [-Werror=implicit-function-declaration] asprintf(&name, "%s/mesa-shared-%s-XXXXXX", path, debug_name); ^~~~~~~~ ../src/util/anon_file.c:141:4: error: implicit declaration of function ‘free’ [-Werror=implicit-function-declaration] free(name); ^~~~ ../src/util/anon_file.c:141:4: warning: incompatible implicit declaration of built-in function ‘free’ ../src/util/anon_file.c:141:4: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’ cc1: some warnings being treated as errors --- src/util/anon_file.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/util/anon_file.c b/src/util/anon_file.c index 184b8445bad..3334e793f5c 100644 --- a/src/util/anon_file.c +++ b/src/util/anon_file.c @@ -33,6 +33,8 @@ #include <unistd.h> #include <fcntl.h> #include <errno.h> +#include <stdio.h> +#include <stdlib.h> #ifdef __FreeBSD__ #include <sys/mman.h> -- 2.20.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev