[Mesa-dev] [PATCH] drm-atomic: Include <stdlib.h> header file

Fabio Estevam festevam at gmail.com
Sat Mar 4 15:01:49 UTC 2017


Include <stdlib.h> header file to fix the following build warning:

  CC       kmscube-drm.o
drm-atomic.c: In function 'init_drm_atomic':
drm-atomic.c:346:14: warning: implicit declaration of function 'calloc' [-Wimplicit-function-declaration]
  drm.plane = calloc(1, sizeof(*drm.plane));
              ^
drm-atomic.c:346:14: warning: incompatible implicit declaration of built-in function 'calloc'
drm-atomic.c:346:14: note: include '<stdlib.h>' or provide a declaration of 'calloc'

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
Hi Rob,

This one is against your recent kmscube tree at:
https://cgit.freedesktop.org/mesa/kmscube/

 drm-atomic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drm-atomic.c b/drm-atomic.c
index b4755e1..0b38c32 100644
--- a/drm-atomic.c
+++ b/drm-atomic.c
@@ -24,6 +24,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
-- 
2.7.4



More information about the mesa-dev mailing list