From: Wolfgang Denk Date: Thu, 03 Sep 2009 12:09:13 +0200 Subject: [U-Boot] [PATCH v2] zlib: fix code when DEBUG is defined In-Reply-To: <011301ca2c7a$b5d83c40$c08182a4@st.com> References: <011301ca2c7a$b5d83c40$c08182a4@st.com> Message-ID: <20090903100913.1FD81832E8DE@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Giuseppe CONDORELLI, In message <011301ca2c7a$b5d83c40$c08182a4@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_