From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 7AC76385841C; Fri, 4 Nov 2022 10:58:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AC76385841C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: bfd-cvs@sourceware.org Subject: [binutils-gdb] opcodes/arm: silence compiler warning about uninitialized variable use X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: b0119424d19afcf80997ad5f3128d7ec68e1fafa X-Git-Newrev: d8521074fe20928d34072701043806f381c5a07d Message-Id: <20221104105823.7AC76385841C@sourceware.org> Date: Fri, 4 Nov 2022 10:58:23 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2022 10:58:23 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd8521074fe20= 928d34072701043806f381c5a07d commit d8521074fe20928d34072701043806f381c5a07d Author: Andrew Burgess Date: Fri Nov 4 10:46:59 2022 +0000 opcodes/arm: silence compiler warning about uninitialized variable use =20 After this commit: =20 commit 6576bffe6cbbb53c5756b2fccd2593ba69b74cdf Date: Thu Jul 7 13:43:45 2022 +0100 =20 opcodes/arm: add disassembler styling for arm =20 Some people were seeing their builds failing with complaints about a possible uninitialized variable usage. I previously fixed an instance of this issue in this commit: =20 commit 2df82cd4b459fbc32120e0ad1ce19e26349506fe Date: Tue Nov 1 10:36:59 2022 +0000 =20 opcodes/arm: silence compiler warning about uninitialized variabl= e use =20 which did fix the build problems that the sourceware buildbot was hitting, however, an additional instance of the same problem was brought to my attention, and that is fixed in this commit. =20 Where commit 2df82cd4b4 fixed the uninitialized variable problem in print_mve_unpredictable, this commit fixes the same problem in print_mve_undefined. =20 As with the previous commit, I don't believe we could really ever get an uninitialized variable usage, based on the current usage of the function, so I have just initialized the reason variable to "??". Diff: --- opcodes/arm-dis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 31ed81f5a4e..47a0a38adec 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -7148,7 +7148,9 @@ print_mve_undefined (struct disassemble_info *info, { void *stream =3D info->stream; fprintf_styled_ftype func =3D info->fprintf_styled_func; - const char *reason; + /* Initialize REASON to avoid compiler warning about uninitialized + usage, though such usage should be impossible. */ + const char *reason =3D "??"; =20 switch (undefined_code) {