Created attachment 9979 [details] Screenshot of the SonarQube UI spotting this bug. The following few lines [1] added recently in osdata.c source file leads to have the overall condition of an 'if' statement being always false (see the attached screenshot). This bug has been detected by SonarQube. [1]- https://github.com/bminor/binutils-gdb/blame/6ca30fa5613cfa935834f27114d6db4f3854a13e/gdb/osdata.c#L300
Hi Freddy, This is a bug in the GDB sources, not the binutils sources. Please could you refile the bug with a Product and Component of GDB ? That way it will be seen by the right people... Cheers Nick
Moving to gdb.
The master branch has been updated by Sergio Durigan Junior <sergiodj@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a5bef50fdbfadbc6b8911b458580ee91cbfcdafd commit a5bef50fdbfadbc6b8911b458580ee91cbfcdafd Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Mon Apr 10 12:43:44 2017 -0400 Fix PR gdb/21364: Dead code due to an unreachable condition in osdata.c Pedro's recent commits enabling -Wwrite-strings has changed a bit the logic of info_osdata. Now, 'type' is always non-NULL, so we have to check if it's an empty string instead of NULL. One of the checks was fixed, but there is another that was left behind. This commit fixes it. gdb/ChangeLog: 2017-04-10 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21364 * osdata.c (info_osdata): Check if 'type' is an empty string instead of NULL.
Fixed, thanks.