You probably need to suppress the warnings for that. The compiler will get rid of them anyway. I thought that this was already done in the generated header but perhaps a different pragma is required if compiling as C++.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Sunil Sawkar > Sent: Monday, November 01, 2010 10:53 AM > To: [email protected] > Subject: [antlr-interest] g++ compiler warnings on the generated lexer > and parser .c files > > Hi, > > Is there anyway to get rid of "unused variables" to eliminate the > compiler warnings such as: > > algoexprLexer.c: In function ‘ANTLR3_INT32 > dfa47_sst(algoexprLexer_Ctx_struct*, ANTLR3_BASE_RECOGNIZER_struct*, > ANTLR3_INT_STREAM_struct*, ANTLR3_CYCLIC_DFA_struct*, ANTLR3_INT32)’: > algoexprLexer.c:10940: warning: unused variable ‘index47_62’ > algoexprLexer.c:10964: warning: unused variable ‘index47_170’ > > algoexprParser.c: In function ‘algoexprParser_set_op_return > set_op(algoexprParser_Ctx_struct*)’: > algoexprParser.c:3478: warning: unused variable ‘LA9_1’ > algoexprParser.c: In function ‘algoexprParser_algo_vector_return > algo_vector(algoexprParser_Ctx_struct*)’: > algoexprParser.c:8901: warning: unused variable ‘LA47_1’ > algoexprParser.c:8915: warning: unused variable ‘LA47_2’ > > I have checked my grammar file to make sure everything in there is > being used. > Yet I see these warnings. When I look in the generated source, I can > see these variables being declared but not referenced anywhere. > > Any help appreciated.. > > -Sunil Sawkar > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
