public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97108] New: Wmaybe-uninitialized false positive
@ 2020-09-18 12:32 clyon at gcc dot gnu.org
  2020-11-06 23:58 ` [Bug tree-optimization/97108] " law at redhat dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-09-18 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97108
           Summary: Wmaybe-uninitialized false positive
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

This testcase causes a false positive 'may be used uninitialized' warning when
compiled with -O2 -Wall. It is derived from libiberty/pex-win32.c
=================================================
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2

int _close(int);

int
pex_win32_exec_child (int flags,
                      int in, int out, int errdes)
{
  int pid = flags;
  int orig_err;
  int separate_stderr = !(flags);

  if (separate_stderr)
    {
      orig_err = errdes;
    }

  if (pid != (int) -1)
    {
      if (in != STDIN_FILENO)
        _close (in);
      if (out != STDOUT_FILENO)
        _close (out);
      if (separate_stderr
          && orig_err != STDERR_FILENO)
        _close (orig_err);
    }

  return pid;
}
=================================================

../pex-win32.c: In function ‘pex_win32_exec_child’:
../pex-win32.c:27:23: warning: ‘orig_err’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
   27 |           && orig_err != STDERR_FILENO)
      |                       ^

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

end of thread, other threads:[~2023-07-07 10:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 12:32 [Bug tree-optimization/97108] New: Wmaybe-uninitialized false positive clyon at gcc dot gnu.org
2020-11-06 23:58 ` [Bug tree-optimization/97108] " law at redhat dot com
2021-04-09 23:37 ` msebor at gcc dot gnu.org
2021-04-09 23:41 ` [Bug tree-optimization/97108] [9/10/11 Regression] -Wmaybe-uninitialized " msebor at gcc dot gnu.org
2021-04-19  7:20 ` rguenth at gcc dot gnu.org
2021-06-01  8:18 ` [Bug tree-optimization/97108] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-11-30 16:33 ` aldyh at gcc dot gnu.org
2022-05-27  9:43 ` [Bug tree-optimization/97108] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-01-09 11:20 ` rguenth at gcc dot gnu.org
2023-04-12 13:30 ` sjames at gcc dot gnu.org
2023-07-04  9:19 ` [Bug tree-optimization/97108] [10/11/12/13/14 " rguenth at gcc dot gnu.org
2023-07-07 10:38 ` [Bug tree-optimization/97108] [11/12/13/14 " rguenth 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).