https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102779
Bug ID: 102779
Summary: gcc.dg/analyzer/capacity-1.c etc.FAIL
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
Target Milestone: ---
Target: *-*-solaris2.11, powerpc-ibm-aix7.2.3.0,
hppa*-hp-hpux11.11, avr-unknown-none
gcc.dg/analyzer/capacity-1.c and gcc.dg/analyzer/capacity-3.c have been FAILing
on several targets, apparently for the same reason:
FAIL: gcc.dg/analyzer/capacity-1.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/capacity-1.c:56:13:
warning: implicit declaration of function 'alloca'
[-Wimplicit-function-declaration]
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/capacity-1.c:56:13:
warning: incompatible implicit declaration of built-in function 'alloca'
[-Wbuiltin-declaration-mismatch]
FAIL: gcc.dg/analyzer/capacity-3.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/capacity-3.c:7:13:
warning: implicit declaration of function 'alloca'
[-Wimplicit-function-declaration]
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/capacity-3.c:7:13:
warning: incompatible implicit declaration of built-in function 'alloca'
[-Wbuiltin-declaration-mismatch]
Unlike Linux, regular system headers don't implicitly declare alloca. E.g. on
Solaris one needs to include <alloca.h>. I wonder how best to fix this: just
use __builtin_alloca directly like some tests do, or have
#define alloca __builtin_alloca
like gcc.dg/analyzer/pr93355-localealias.c.