Dear Prafulla,

In message <73173d32e9439e4abb5151606c3e19e202e3915...@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.

> 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?

My "const"-adding patch was the more or less direct result of getting
rid of the warnings without using additional type casts.

I think using const is a good thing. I am aware that it sometimes
becomes painful, and some consider it a waste of time.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
God made machine language; all the rest is the work of man.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to