Received: from eggs.gnu.org ([2001:4830:134:3::10]:32974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmGMb-000575-Q3 for qemu-devel@nongnu.org; Tue, 20 Sep 2016 04:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmGMX-0005gW-Lq for qemu-devel@nongnu.org; Tue, 20 Sep 2016 04:25:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmGMX-0005gB-FH for qemu-devel@nongnu.org; Tue, 20 Sep 2016 04:25:09 -0400 References: <20160919155139.28371-1-alex.bennee@linaro.org> <20160919155139.28371-2-alex.bennee@linaro.org> From: Paolo Bonzini Message-ID: <0f874df1-b508-9587-09f6-798c466c3e73@redhat.com> Date: Tue, 20 Sep 2016 10:24:59 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 1/8] ui/vnc-enc-tight: add abort() for unexpected default List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , =?UTF-8?Q?Alex_Benn=c3=a9e?= , qemu-devel@nongnu.org, cota@braap.org, stefanha@redhat.com, kwolf@redhat.com Cc: mttcg@greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, nikunj@linux.vnet.ibm.com, jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, Gerd Hoffmann , serge.fdrv@gmail.com, bobby.prani@gmail.com, rth@twiddle.net, fred.konrad@greensocs.com On 20/09/2016 10:02, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Mon, Sep 19, 2016 at 7:58 PM Alex Benn=C3=A9e > wrote: >=20 > When enabling the sanitizer build it will complain about control > reaching a non-void function. Normally the compiler should detect t= hat > there is only one possible exit given a static VNC_SERVER_FB_BYTES. >=20 > As we should never get here I added an abort() rather than a defaul= t > return value. >=20 > Signed-off-by: Alex Benn=C3=A9e > > --- > ui/vnc-enc-tight.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c > index 49df85e..9e4d254 100644 > --- a/ui/vnc-enc-tight.c > +++ b/ui/vnc-enc-tight.c > @@ -710,6 +710,8 @@ static bool check_solid_tile(VncState *vs, int > x, int y, int w, int h, > switch (VNC_SERVER_FB_BYTES) { > case 4: > return check_solid_tile32(vs, x, y, w, h, color, samecolor= ); > + default: > + abort(); > } > } >=20 >=20 >=20 > Reviewed-by: Marc-Andr=C3=A9 Lureau > >=20 > Looks fine. Would it make sense to use a > G_STATIC_ASSERT(VNC_SERVER_FB_BYTES =3D=3D 4) above instead? Or QEMU_BUILD_BUG_ON(VNC_SERVER_FB_BYTES !=3D 4) :) Paolo > --=20 > Marc-Andr=C3=A9 Lureau