lkml.org 
[lkml]   [2002]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] 2.4.19 warnings cleanup
From
Date
Paul Mackerras <paulus@au1.ibm.com> writes:

> > > --- linux/drivers/net/ppp_generic.c.orig Sat Aug 3 17:13:58 2002
> > > +++ linux/drivers/net/ppp_generic.c Sat Aug 3 19:11:54 2002
> > > @@ -378,7 +378,7 @@
> > > {
> > > struct ppp_file *pf = file->private_data;
> > > DECLARE_WAITQUEUE(wait, current);
> > > - ssize_t ret;
> > > + ssize_t ret = 0; /* suppress compiler warning */
> > > struct sk_buff *skb = 0;
> > >
> The code is in ppp_read actually OK; if you trace through the logic
> you can prove that ret is never actually used without being set first.

That's right - that's exactly why I wrote "suppress compiler warning".
It's just the compiler not smart enough (of course, i looked at the code
paths and I'd just fix it if it was broken).

Anyway, it seems there are more places like that in the kernel tree, so,
as Alan said, the correct thing to improve is the compiler (not even sure
if gcc3 would print the warning, I'm using RH "2.96" gcc).
--
Krzysztof Halasa
Network Administrator
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:27    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site