[Bug fortran/124258] gcc/fortran/decl.cc:4970: Pointless test ?

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 26 12:49:27 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124258

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
There is another pointless test in file gcc/fortran/check.cc, line 1888.

Cppcheck says:

gcc/fortran/check.cc:1888:7: style: Redundant condition:
string->ts.type==BT_CHARACTER. 'A || (!A && B)' is equivalent to 'A || B'
[redundantCondition]

Source code is

  if (string->ts.type != BT_CHARACTER
      || (string->ts.type == BT_CHARACTER
      && (string->ts.kind != gfc_default_character_kind)))


More information about the Gcc-bugs mailing list