Commit 98116973 authored by Andreas Arnez's avatar Andreas Arnez
Browse files

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.
parent 90fd07fc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment