aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-11-04 10:46:59 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-11-04 10:46:59 +0000
commitd8521074fe20928d34072701043806f381c5a07d (patch)
tree6e00668737847e7ee27cbb9821ff4e68890d444d /opcodes
parentb0119424d19afcf80997ad5f3128d7ec68e1fafa (diff)
downloadgdb-d8521074fe20928d34072701043806f381c5a07d.zip
gdb-d8521074fe20928d34072701043806f381c5a07d.tar.gz
gdb-d8521074fe20928d34072701043806f381c5a07d.tar.bz2
opcodes/arm: silence compiler warning about uninitialized variable use
After this commit: commit 6576bffe6cbbb53c5756b2fccd2593ba69b74cdf Date: Thu Jul 7 13:43:45 2022 +0100 opcodes/arm: add disassembler styling for arm 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: commit 2df82cd4b459fbc32120e0ad1ce19e26349506fe Date: Tue Nov 1 10:36:59 2022 +0000 opcodes/arm: silence compiler warning about uninitialized variable use 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. Where commit 2df82cd4b4 fixed the uninitialized variable problem in print_mve_unpredictable, this commit fixes the same problem in print_mve_undefined. 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 "??".
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/arm-dis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 31ed81f..47a0a38 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -7148,7 +7148,9 @@ print_mve_undefined (struct disassemble_info *info,
{
void *stream = info->stream;
fprintf_styled_ftype func = 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 = "??";
switch (undefined_code)
{