rbug: Fix use of alloca() without #include "c99_alloca.h"
authorJon Turney <jon.turney@dronecode.org.uk>
Sat, 19 Oct 2019 13:43:49 +0000 (14:43 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Fri, 25 Oct 2019 15:04:34 +0000 (16:04 +0100)
[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 alloca() prototype available.

See also: 498d9d0fadfb9c5cfc8139b1

Fixes: 6174cba7 ("rbug: fix transmitted texture sizes")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/auxiliary/rbug/rbug_texture.c

index 768e9505cca65fcdbdebba8df19a55b773d7a245..b0d8c60d46dcfd86d1bc553dbb2857f56bc3f18b 100644 (file)
@@ -34,6 +34,8 @@
  * Functions ending with _reply are replies to requests.
  */
 
+#include "c99_alloca.h"
+
 #include "rbug_internal.h"
 #include "rbug_texture.h"