blob: 6923bf70537985b8aea6b154fd8f307a220db15e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001[PATCH] fix a stack-usage warning
2
3Upstream-Status: Pending
4
5not use a variable to as a array size, otherwise the warning to error that
6stack usage might be unbounded [-Werror=stack-usage=] will happen
7
8Signed-off-by: Roy Li <rongqing.li@windriver.com>
9---
10 backends/ppc_initreg.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
14index 64f5379..52dde3e 100644
15--- a/backends/ppc_initreg.c
16+++ b/backends/ppc_initreg.c
17@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
18 return false;
19 }
20 const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
21- Dwarf_Word dwarf_regs[gprs];
22+ Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)];
23 for (unsigned gpr = 0; gpr < gprs; gpr++)
24 dwarf_regs[gpr] = user_regs.r.gpr[gpr];
25 if (! setfunc (0, gprs, dwarf_regs, arg))
26--
271.9.1
28