public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/98879] New: gcc/ada/terminals.c:732: redundantAssignment ?
@ 2021-01-29  8:33 dcb314 at hotmail dot com
  2021-01-29  8:35 ` [Bug ada/98879] " dcb314 at hotmail dot com
  2021-01-29  9:28 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: dcb314 at hotmail dot com @ 2021-01-29  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98879
           Summary: gcc/ada/terminals.c:732: redundantAssignment ?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk.git/gcc/ada/terminals.c:732:10: style: Variable 'cpid' is reassigned a
value before the old one has been used. [redundantAssignment]

Source code is

    bRet = ReadFile(process->w_outfd, buf, 8, &count, NULL);
    if (bRet == FALSE) {
      cpid = -1;
    }

    dwRet = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
    if (dwRet != 0) {
      cpid = -1;
    }

    cpid = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24);
    process->pid = cpid;

Why bother setting cpid if it is ignored a few lines later ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/98879] gcc/ada/terminals.c:732: redundantAssignment ?
  2021-01-29  8:33 [Bug ada/98879] New: gcc/ada/terminals.c:732: redundantAssignment ? dcb314 at hotmail dot com
@ 2021-01-29  8:35 ` dcb314 at hotmail dot com
  2021-01-29  9:28 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dcb314 at hotmail dot com @ 2021-01-29  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |charlet at gcc dot gnu.org

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Adding author of code.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/98879] gcc/ada/terminals.c:732: redundantAssignment ?
  2021-01-29  8:33 [Bug ada/98879] New: gcc/ada/terminals.c:732: redundantAssignment ? dcb314 at hotmail dot com
  2021-01-29  8:35 ` [Bug ada/98879] " dcb314 at hotmail dot com
@ 2021-01-29  9:28 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-29  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-01-29
                 CC|                            |marxin at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-29  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  8:33 [Bug ada/98879] New: gcc/ada/terminals.c:732: redundantAssignment ? dcb314 at hotmail dot com
2021-01-29  8:35 ` [Bug ada/98879] " dcb314 at hotmail dot com
2021-01-29  9:28 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).