From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3645228935945429677==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: Re: [PATCH] libebl: Fix missing brackets around if statement body. Date: Mon, 11 Jan 2016 08:43:23 +0100 Message-ID: <20160111074323.GC5111@blokker.redhat.com> In-Reply-To: 1452374806-14958-1-git-send-email-mjw@redhat.com --===============3645228935945429677== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sat, Jan 09, 2016 at 10:26:46PM +0100, Mark Wielaard wrote: > GCC6 [will have] a nice new warning that showed a real bug: > = > elfutils/libebl/eblobjnote.c: In function =E2=80=98ebl_object_note=E2=80= =99: > elfutils/libebl/eblobjnote.c:135:5: error: statement is indented as if it= were guarded by... [-Werror=3Dmisleading-indentation] > switch (type) > ^~~~~~ > = > elfutils/libebl/eblobjnote.c:45:3: note: ...this =E2=80=98if=E2=80=99 cla= use, but it is not > if (! ebl->object_note (name, type, descsz, desc)) > ^~ > = > And indeed, it should have been under the if, but wasn't because of missi= ng > brackets. Added brackets (and reindent). I pushed this to master because the actual bug fix is really small. It just looks big because of the reindentation, but the diff -w is: diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c index fa1eb93..f80a1a5 100644 --- a/libebl/eblobjnote.c +++ b/libebl/eblobjnote.c @@ -1,5 +1,5 @@ /* Print contents of object file note. - Copyright (C) 2002, 2007, 2009, 2011, 2015 Red Hat, Inc. + Copyright (C) 2002, 2007, 2009, 2011, 2015, 2016 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper , 2002. = @@ -43,6 +43,7 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t typ= e, uint32_t descsz, const char *desc) { if (! ebl->object_note (name, type, descsz, desc)) + { /* The machine specific function did not know this type. */ = if (strcmp ("stapsdt", name) =3D=3D 0) @@ -229,3 +230,4 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t t= ype, break; } } +} And so that 0.165 will build out of the box with GCC6. Cheers, Mark --===============3645228935945429677==--