PR26279 Work around maybe-uninitialized warning in s390-mkopc.c
authorAndreas Arnez <arnez@linux.ibm.com>
Wed, 29 Jul 2020 17:46:44 +0000 (19:46 +0200)
committerAndreas Arnez <arnez@linux.ibm.com>
Wed, 29 Jul 2020 17:46:44 +0000 (19:46 +0200)
commit9811697376b3f1950419ab13b19e2995703b839b
treea7b1a220104d285867830af766018a70828700b8
parent90fd07fcd3e6af8679df55b67482d5c8ab8dd9b9
PR26279 Work around maybe-uninitialized warning in s390-mkopc.c

In s390-mkopc.c, the function insertExpandedMnemonic() searches for the
first occurrence of '*' or '$' in the given mnemonic, and, if a match is
found, chooses an extension table using a switch() on that character.  The
switch statement contains a default case that prints an error message and
does not set the extension table.  Although this case cannot occur, some
GCC versions obviously conclude that the extension table might have been
left uninitialized after the switch statement and consequently emit
maybe-uninitialized warnings for the variables 'ext_table' and
'ext_table_length'.

Circumvent the warning by handling the unreachable default case with
abort().

opcodes/
* s390-mkopc.c (insertExpandedMnemonic): Handle unreachable
default case with abort() instead of printing an error message and
continuing, to avoid a maybe-uninitialized warning.
opcodes/ChangeLog
opcodes/s390-mkopc.c
This page took 0.031009 seconds and 4 git commands to generate.