Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MH04d-0005vY-Ta for qemu-devel@nongnu.org; Wed, 17 Jun 2009 14:41:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MH04Z-0005sq-09 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 14:41:27 -0400 Received: from [199.232.76.173] (port=57903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MH04Y-0005sj-RK for qemu-devel@nongnu.org; Wed, 17 Jun 2009 14:41:22 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:52686) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MH04X-0004Su-MA for qemu-devel@nongnu.org; Wed, 17 Jun 2009 14:41:22 -0400 Received: from smtp4-g21.free.fr (localhost [127.0.0.1]) by smtp4-g21.free.fr (Postfix) with ESMTP id 58A8F4C8155 for ; Wed, 17 Jun 2009 20:41:17 +0200 (CEST) Received: from jcd-laptop.localnet (unknown [78.235.240.156]) by smtp4-g21.free.fr (Postfix) with ESMTP id EB75D4C8204 for ; Wed, 17 Jun 2009 20:41:14 +0200 (CEST) From: "Jean-Christophe Dubois" Subject: Re: [Qemu-devel] [PATCH v3] avoid compilation warning/errors on up to date compilers/glibc Date: Wed, 17 Jun 2009 20:41:14 +0200 References: <28684080.110231245246057655.JavaMail.root@srv-05.w4a.fr> <200906171503.52825.paul@codesourcery.com> In-Reply-To: <200906171503.52825.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906172041.14849.jcd@tribudubois.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Le mercredi 17 juin 2009 16:03:51, vous avez =C3=A9crit : > > > This is no more correct than before. read() can return EINTR and that > > > should be handled appropriately. Elsewhere, read() can return partial > > > results and we ought to handle that properly. > > > > It handles all cases except EINTR. And in the actual code base EINTR and > > __all other__ error cases are not handled. So as of today EINTR is not > > handled propely (as well as all other error cases). So this consider > > EINTR as an error when it could be handled in a nicer way. Previously no > > ERRORS were considered as an error. What is best? > > The original is the lesser wevil because it is obviously wrong. Your patch > looks like it does error handling and avoids generates warnings, but still > does not work correctty. > > > > Using -D_FORTIFY_SOURCES=3D0 will eliminate these warnings. If we're > > > going to fix these things, we should fix them properly. > > > > It just hides the problem and fix nothing but the compilation. > > Your patch just makes the bug more subtle and harder to spot. I guess this is a matter of point of view.=20 Is it harder to find a bug when: 1) you are silencing compilation warning/errors AND ignoring all runtime=20 errors (also silencing future warnings/errors). or 2) You are considering recoverable errors as non recoverable errors. You make your call. Anyway fixing all those "bad" calls the "proper" way will be quite involved. BTW are you sure that EINTR and EAGAIN are correctly handled all over the=20 source code? What about partial read/write? JC > > Paul