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

            Bug ID: 102083
           Summary: libiberty/simple-object-xcoff.c:844: pointless test
                    and assignment ?
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

libiberty/simple-object-xcoff.c:844:5: style: Assignment of function parameter
has no effect outside the function. [uselessAssignmentArg]

Source code is

  if (align > 13)
    align = 13;
  if (u64)
    set_32 (hdr + offsetof (struct external_scnhdr, u.xcoff64.s_flags), flags);
  else
    set_32 (hdr + offsetof (struct external_scnhdr, u.xcoff32.s_flags), flags);

  return simple_object_internal_write (descriptor, scnhdr_offset, hdrbuf,
                                       u64 ? SCNHSZ64 : SCNHSZ32,
                                       errmsg, err);
}

Suggest remove test and set of align, since they are not used in the rest
of the function.

Reply via email to