[PATCH] Fix an overflow case in fdt_offset_ptr() detected by GCC 4.3.

David Gibson david at gibson.dropbear.id.au
Tue Sep 30 11:15:25 EST 2008


On Mon, Sep 29, 2008 at 04:13:27PM -0500, Jon Loeliger wrote:
> > 
> > Using Gcc 4.3 detected this problem:
> > 
> >     ../dtc/libfdt/fdt.c: In function 'fdt_next_tag':
> >     ../dtc/libfdt/fdt.c:82: error: assuming signed overflow does not
> >     occur when assuming that (X + c) < X is always false
> > 
> > To fix the problem, treat the offset as an unsigned int.
> > 
> > The problem report and proposed fix were provided
> > by Steve Papacharalambous <stevep at freescale.com>.
> > 
> > Signed-off-by: Jon Loeliger <jdl at freescale.com>
> 
> Applied.

Uh.. Jon.. did you see my reply to this.  I'm not at all convinced
this patches a real problem.  I suspect it's just replacing a problem
that gcc could detect with a similar one that gcc can't (and for which
we already had a test to deal with, anyway).

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the devicetree-discuss mailing list