[U-Boot] [PATCH "mkimage" branch] tools/mkimage: fix compiler warnings, use "const"

Prafulla Wadaskar prafulla at marvell.com
Thu Aug 20 11:50:21 CEST 2009


 

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de] 
> Sent: Thursday, August 20, 2009 2:58 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH "mkimage" branch] tools/mkimage: 
> fix compiler warnings, use "const"
> 
> Dear Prafulla,
> 
> In message 
> <73173D32E9439E4ABB5151606C3E19E202E3915996 at SC-VEXCH1.marvell.
> com> you wrote:
> > 
> > > This fixes some compiler warnings:
> > > tools/default_image.c:141: warning: initialization from 
> > > incompatible pointer type
> > > tools/fit_image.c:202: warning: initialization from 
> > > incompatible pointer type
> > > and changes to code to use "const" attributes in a few 
> places where
> > > it's appropriate.
> >
> > 99% of the changes in this patch is to add const attributes.
> 
> Yes, indeed.
> 
> > Can you pls explain here- how useful it is to add const.
> 
> Well, adding "const" where appropriate is definitely a good thing, as
> it const augments data-hiding and encapsulation and allows the
> compiler to check for (and prevent!) unintended modification of data
> structures, i. e. for programming errors. Also, it helps the compiler
> for better optimization.
Ack

> 
> > Or do it make more sense just to fix the warnings in 
> respective functions?
> > I have posted a patch for the same
> 
> I did not see any patch form you addressing these warnings?
It's in my mailq :-(, I will repost it just FYI

Regards..
Prafulla . .



More information about the U-Boot mailing list