summaryrefslogtreecommitdiff
path: root/patches/mesa-mesa/0001-rbug-Fix-use-of-alloca-without-include-c99_alloca.h.patch
blob: 90c3a1c8623bb4c68263377402ecef9bddcc44ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 2fce58cfa24b4f725e162778c163b753f9722c2f Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Sat, 19 Oct 2019 14:43:49 +0100
Subject: [PATCH] rbug: Fix use of alloca() without #include <c99_alloca.h>

[12/60] Compiling C object 'src/gallium/auxiliary/eb820e8@@gallium@sta/rbug_rbug_texture.c.o'.
FAILED: src/gallium/auxiliary/eb820e8@@gallium@sta/rbug_rbug_texture.c.o
[...]
../src/gallium/auxiliary/rbug/rbug_texture.c: In function 'rbug_send_texture_info_reply':
../src/gallium/auxiliary/rbug/rbug_texture.c:302:21: error: implicit declaration of function 'alloca'; did you mean 'malloc'? [-Werror=implicit-function-declaration]
  uint32_t *height = alloca(sizeof(uint32_t) * height_len);
                     ^~~~~~
                     malloc
../src/gallium/auxiliary/rbug/rbug_texture.c:302:21: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
../src/gallium/auxiliary/rbug/rbug_texture.c:303:20: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
  uint32_t *depth = alloca(sizeof(uint32_t) * height_len);
                    ^~~~~~
cc1: some warnings being treated as errors

Include c99_alloca.h to portably make the alloc() prototype available.

Fixes: 6174cba7 ("rbug: fix transmitted texture sizes")

See also: 498d9d0f, adfb9c5c, fc8139b1
---
 src/gallium/auxiliary/rbug/rbug_texture.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/rbug/rbug_texture.c b/src/gallium/auxiliary/rbug/rbug_texture.c
index 768e9505cca..83fdbac59ef 100644
--- a/src/gallium/auxiliary/rbug/rbug_texture.c
+++ b/src/gallium/auxiliary/rbug/rbug_texture.c
@@ -34,6 +34,8 @@
  * Functions ending with _reply are replies to requests.
  */
 
+#include <c99_alloca.h>
+
 #include "rbug_internal.h"
 #include "rbug_texture.h"
 
-- 
2.21.0