From 512e6270ea316b5a07656b060419a38c1e5a818f Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 20 Feb 2024 14:11:57 -0500 Subject: [PATCH] Silences gcc warning warning: expression does not compute the number of elements in this array Seems like gcc thinks we're trying to get the number of elements in our array or something like that. It then suggests adding parentheses to silence the warning. --- celt/stack_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/celt/stack_alloc.h b/celt/stack_alloc.h index ae40e2a1..e2739bdf 100644 --- a/celt/stack_alloc.h +++ b/celt/stack_alloc.h @@ -141,7 +141,7 @@ extern char *global_stack_top; #else #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) -#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char)))) +#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/(sizeof(char))),(stack)+=(size)*(sizeof(type)/(sizeof(char))),(type*)((stack)-(size)*(sizeof(type)/(sizeof(char))))) #if 0 /* Set this to 1 to instrument pseudostack usage */ #define RESTORE_STACK (printf("%ld %s:%d\n", global_stack-scratch_ptr, __FILE__, __LINE__),global_stack = _saved_stack) #else