Compile errors in *.y file (yacc ???)

J

Jarek

Hello!

I'm trying to fix code of esnacc to compile it in gcc4.0. I've fixed
almost all c/c++ code, but I've completly no idea about yacc.
Can someone help me how to fix the following warnings:

core/parse-asn1.y: In function 'yyparse':
core/parse-asn1.y:1517: warning: format '%ld' expects type 'long int',
but argument 4 has type 'AsnInt'
core/parse-asn1.y: In function 'InitAsn1Parser':
core/parse-asn1.y:3537: warning: implicit declaration of function
'yyrestart'


Below is the code:

@1515:
else
{
PrintErrLoc (modulePtrG->asn1SrcFileName, $3->lineNo);
fprintf (errFileG, "ERROR - attempt to implicitly reference
untagged type\n");
smallErrG = 1;
}

@3535:
#ifdef FLEX_IN_USE
if (!firstTimeThroughG)
yyrestart (fPtr);

firstTimeThroughG = FALSE;
#endif

best regards
Jarek
 
H

Heinz Ozwirk

Jarek said:
Hello!

I'm trying to fix code of esnacc to compile it in gcc4.0. I've fixed
almost all c/c++ code, but I've completly no idea about yacc.
Can someone help me how to fix the following warnings:

core/parse-asn1.y: In function 'yyparse':
core/parse-asn1.y:1517: warning: format '%ld' expects type 'long int', but
argument 4 has type 'AsnInt'
core/parse-asn1.y: In function 'InitAsn1Parser':
core/parse-asn1.y:3537: warning: implicit declaration of function
'yyrestart'

Which errors? Those are only warnings. For the first one, check the
definition of AsnInt. If it is typedef'ed as 'long int' or just 'long',
ignore that warning. Otherwise test with a little program that you can
printf a value of type AsnInt when a long int is expected. The second error
you can safely ignore. It just tells you that there is no prototype for
yyrestart, and the compiler simply assumes that the call matches the
definition of that function.

HTH
Heinz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,170
Latest member
Andrew1609
Top