[Flex-help] flex-2.5.37 test test-bison-yylloc 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:33:24
|
OKay, here is one of those single char patches, trivial I know but it was in the middle of a header that incorrectly redefined function(pointer to void) returning int in parser.h.
ERROR was :
$ cat OUTPUT
gmake[5]: Entering directory `/usr/local/build/flex-2.5.37_SunOS5.10_sparcv9.001/tests/test-bison-yylloc'
../../flex scanner.l
/usr/local/bin/bison --defines --output=parser.c --name-prefix="test" parser.y
/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 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 1384: warning: implicit function declaration: testlex
"parser.c", line 1561: warning: argument #1 is incompatible with prototype:
prototype: pointer to char : "parser.y", line 38
argument : pointer to const char
/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 98
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-yylloc'
$
Fix is :
$ diff parser.h_backup parser.h
98c98
< int testparse (void);
---
> int testparse (void *);
Results are :
$ 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-yylloc scanner.o parser.o main.o
./test-bison-yylloc < ./test.input
0001: FIRSTNAME=firstname
0002: MIDDLENAME=middle
0003: LASTNAME=lastname
0004: ADDRESS=address
$
OKay .. am working on the next one now.
Dennis
|