Re: [PATCH] 2.4.19 warnings cleanup

bill davidsen (davidsen@tmr.com)
7 Aug 2002 02:07:42 GMT


In article <20020804.200246.26945647.davem@redhat.com>,
David S. Miller <davem@redhat.com> wrote:

| A compiler isn't able to work out the control flow which
| makes sure ret is indeed initialized on every path to
| a use. Solving such a problem is traveling salesman'ish :-)

This is true, but on the other hand I don't see much virtue in taking
the attitude that I'm sure the compiler is wrong to avoid the overhead
of initializing the variable or clarifying the code.

I totally agree that there are cases in which the compiler can't be sure
and the programmer is based on some outside assumptions of input values
or whatever, but I don't mind making the code robust in cases other than
innermost loops where I just can't fix it.

I'd rather set the initial value to NOTSET or NULL or some value which
will clearly show if you are setting what you think you are. I've
occasionally been surprised, particularly when trusting values passed
into a procedure.

Just my take on reliable vs. fast.

-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/