Tests rely on alloca()

Anthony J. Bentley anthony at cathet.us
Wed Apr 24 08:25:56 BST 2013


Hi,

Several tests use alloca() to allocate memory. But alloca() is not part of
C99, and on OpenBSD this leads to linking errors since the NetSurf build
system specifies -std=c99:

LINK: build-OpenBSD-OpenBSD-release-lib-shared/test_parser
cc -o build-OpenBSD-OpenBSD-release-lib-shared/test_parser build-OpenBSD-OpenBSD-release-lib-shared/test_parser.o -Lbuild-OpenBSD-OpenBSD-release-lib-shared/ -lhubbub -g -L/usr/local/lib -liconv -L/usr/local/lib -ljson-c
build-OpenBSD-OpenBSD-release-lib-shared/test_parser.o(.text+0x578): In function `run_test':
test/parser.c:28: undefined reference to `alloca'
collect2: ld returned 1 exit status

These are the files that use alloca():

libhubbub:
test/parser.c
test/tokeniser2.c
test/tokeniser3.c
test/tree.c

libcss:
test/css21.c
test/parse-auto.c

libparserutils:
test/cscodec-8859.c
test/cscodec-ext8.c
test/cscodec-utf8.c
test/cscodec-utf16.c



More information about the netsurf-dev mailing list