help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning in Flex


From: Artur Kedzierski
Subject: Re: Warning in Flex
Date: Mon, 20 May 2002 17:03:33 -0700 (PDT)

        Two things:
        1. It is machine generated code intermingled with human written
code.
        2. Compile time options are often set globally for a group of files
and not indiviually for each source file.
        Anyway, I didn't send email to discuss the importance of this
warning or to complain about Flex. I am involved in a project that has
about 100K lines of code. Flex has been very helpful for us. The
only warning that we get is the 'find_rule' one.
        By asking a question here, I was hoping to find out if I missed out an
option or if this is something that will be addressed in future version
(as the warning is generated by GNU GCC).


--
=================================================================
Artur Kedzierski,                   || address@hidden
Computer Science Graduate Division  || http://www.kedzierski.org/
University of California, Riverside ||


On Tue, 21 May 2002, Hans-Bernhard Broeker wrote:

> On Mon, 20 May 2002, Artur Kedzierski wrote:
>
> >     Is there any way to remove the warning:
> > "warning: label `find_rule' defined but not used" ?
>
> Well, there always is: go into the source, find it, and remove it (or
> rather, #ifdef it out based on some appropriate test).
>
> >     I've noticed it appears when %option yylineno is used. I've search
> > the net and found that other projects are having problems with it but
> > nobody has the solution.
>
> I don't quite agree to calling this a problem that needs to be solved.
> It's some bit of an inconvenience that your compiler won't accept the code
> generated by flex without warnings, but that's all it is.  It's just a
> *warning*.  The situation it complains about is essentially harmless.
>
> It's questionable whether it's even a good idea to compile
> machine-generated source using compiler warning options originally meant
> to check and improve human-written code.  The warnings about unused or
> unreachable code fall into this category: for human-written code, they
> provide an early warning concerning quality of coders' workmanship or
> means to simplify the code, whereas for machine-generated code, they can
> be hard enough to avoid as to cause more harm than good.
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]