From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A9D4385700B; Wed, 22 Jul 2020 13:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A9D4385700B From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/26279] New: [s390, Wmaybe-uninitialized] Warnings in opcodes/s390-mkopc.c Date: Wed, 22 Jul 2020 13:22:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 13:22:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26279 Bug ID: 26279 Summary: [s390, Wmaybe-uninitialized] Warnings in opcodes/s390-mkopc.c Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Warnings with -Wall: ... /home/vries/gdb_versions/devel/src/opcodes/s390-mkopc.c: In function 'main': /home/vries/gdb_versions/devel/src/opcodes/s390-mkopc.c:171:7: warning: 'ext_table_length' may be used uninitialized in this function [-Wmaybe-uninitialized] 171 | int ext_table_length; | ^~~~~~~~~~~~~~~~ /home/vries/gdb_versions/devel/src/opcodes/s390-mkopc.c:170:38: warning: 'ext_table' may be used uninitialized in this function [-Wmaybe-uninitializ= ed] 170 | const struct s390_cond_ext_format *ext_table; | ^~~~~~~~~ ... Corresponding code: ... const struct s390_cond_ext_format *ext_table; int ext_table_length; ... switch (*tag) { case '*': ext_table =3D s390_cond_extensions; ext_table_length =3D NUM_COND_EXTENSIONS; break; case '$': ext_table =3D s390_crb_extensions; ext_table_length =3D NUM_CRB_EXTENSIONS; break; default: fprintf (stderr, "Unknown tag char: %c\n", *tag); } for (i =3D 0; i < ext_table_length; i++) { char new_mnemonic[15]; strcpy (new_mnemonic, prefix); opcode[mask_start] =3D ext_table[i].nibble; strcat (new_mnemonic, ext_table[i].extension); strcat (new_mnemonic, suffix); insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags= ); } ... --=20 You are receiving this mail because: You are on the CC list for the bug.=