[U-Boot] [PATCH v2] zlib: fix code when DEBUG is defined

Wolfgang Denk wd at denx.de
Thu Sep 3 12:09:13 CEST 2009


Dear Giuseppe CONDORELLI,

In message <011301ca2c7a$b5d83c40$c08182a4 at st.com> you wrote:
> 
> > What happens when we return here? Obviously this function is supposed
> > to never return. Should we call hang() here?
> 
> Given that z_error is invoked by Assert macro (never used) and that "exit"
> function (other than closing all
> opened stream) will terminate program execution, I suggest to remove it
> without adding others instructions letting
> u-boot to hang by itself (if it will do this).

Well, if you just return from z_error() after an error condition  was
detected, and continue to run, this will cause undefined behaviour. I
prefer  to  have  a  clear  error  condition  which halts the system,
instead of having a system which continues to  run  but  does  random
things on me, eventually causing bigger damages.

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: wd at denx.de
Time is a drug. Too much of it kills you.
                                      - Terry Pratchett, _Small Gods_


More information about the U-Boot mailing list