This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/82648] New: libiberty/regex.c:2364]: pointless test ?


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

            Bug ID: 82648
           Summary: libiberty/regex.c:2364]: pointless test ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk/libiberty/regex.c:2364]: (style) Checking if unsigned variable 'size' is
less than zero.

Source code is

  if (size < 0)

but

  size_t size;

Maybe the error return value from function convert_mbs_to_wcs is zero
and so the test should be

  if (size == 0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]