I have a feeling there's something fishy in the flex Arch package.

Could anyone tell me what's wrong in the attached example (which is a 
copy-paste from the documentation *).

The output:
$ make
gcc -lfl -o rez lex.yy.c
/tmp/ccK1yJvZ.o: In function `main':
lex.yy.c:(.text+0x1795): multiple definition of `main'
/usr/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libfl.a(libmain.o):: first 
defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 27 
in /usr/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libfl.a(libmain.o) to 66 
in /tmp/ccK1yJvZ.o
/tmp/ccK1yJvZ.o: In function `yylex':
lex.yy.c:(.text+0x3c7): undefined reference to `yywrap'
/tmp/ccK1yJvZ.o: In function `input':
lex.yy.c:(.text+0xd2c): undefined reference to `yywrap'
collect2: ld returned 1 exit status
make: *** [rez] Error 1

* http://www.gnu.org/software/flex/manual/html_chapter/flex_5.html

Rebuilding flex shows:
...
patching file flex.skl
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file flex.skl.rej
patching file gen.c
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file gen.c.rej
...
checking for yywrap in -lfl... yes
...


Does anyone know what's wrong with it?

Thanks,
Mircea

-- 
Psi Forums Moderator/Bug Tracker Manager
Psi Windows Installer Maintainer/ArchLinux Package Maintainer
http://mircea.bardac.net
        int num_lines = 0, num_chars = 0;

%%
\n      ++num_lines; ++num_chars;
.       ++num_chars;

%%

main()
        {
        yylex();
        printf( "# of lines = %d, # of chars = %d\n",
                num_lines, num_chars );
        }
.PHONY: all
all: rez

rez: lex.yy.o
	gcc -lfl -o rez lex.yy.c

lex.yy.c: t0.lex
	flex t0.lex

.PHONY: clean
clean:
	rm -f lex.yy.c rez

Attachment: pgpkmaquGWPzW.pgp
Description: PGP signature

_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch

Reply via email to