[Flex-help] flex-2.5.37 test test-bison-yylval fails due to error: identifier redeclared: testparse
flex is a tool for generating scanners
Brought to you by:
wlestes
|
From: Dennis C. <dc...@bl...> - 2012-11-08 20:42:18
|
ERROR was :
$ cat OUTPUT
gmake[5]: Entering directory `/usr/local/build/flex-2.5.37_SunOS5.10_sparcv9.001/tests/test-bison-yylval'
/usr/local/bin/bison --defines --output=parser.c --name-prefix="test" parser.y
/opt/solarisstudio12.3/bin/cc -c -o parser.o -I. -I../.. -I../.. -I. -I/usr/local/include -I/usr/sfw/include -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE parser.c
"parser.c", line 1296: warning: implicit function declaration: testlex
"parser.c", line 1477: warning: argument #1 is incompatible with prototype:
prototype: pointer to char : "parser.y", line 38
argument : pointer to const char
../../flex scanner.l
/opt/solarisstudio12.3/bin/cc -c -o scanner.o -I. -I../.. -I../.. -I. -I/usr/local/include -I/usr/sfw/include -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE scanner.c
/opt/solarisstudio12.3/bin/cc -c -o main.o -I. -I../.. -I../.. -I. -I/usr/local/include -I/usr/sfw/include -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE main.c
"main.c", line 27: error: identifier redeclared: testparse
current : function(pointer to void) returning int
previous: function(void) returning int : "parser.h", line 85
cc: acomp failed for main.c
gmake[5]: *** [main.o] Error 2
gmake[5]: Leaving directory `/usr/local/build/flex-2.5.37_SunOS5.10_sparcv9.001/tests/test-bison-yylval'
$
My one char ( okay two if you count the space ) fix is :
$ diff parser.h_backup parser.h
85c85
< int testparse (void);
---
> int testparse (void *);
RESULT :
$ gmake test
/opt/solarisstudio12.3/bin/cc -c -o scanner.o -I. -I../.. -I../.. -I. -I/usr/local/include -I/usr/sfw/include -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE scanner.c
/opt/solarisstudio12.3/bin/cc -c -o main.o -I. -I../.. -I../.. -I. -I/usr/local/include -I/usr/sfw/include -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE main.c
/opt/solarisstudio12.3/bin/cc -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -o test-bison-yylval parser.o scanner.o main.o
./test-bison-yylval < ./test.input
$
>From the tippity top we should have only two tests fail because, and we know this already, we should use cmp as opposed to diff due to a non-standard option.
I'll do some testing and get onto RHEL6 to ensure this works on Linux also.
dc
|