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 middle-end/63518] New: missing Wuninitialized warning independent of order of arguments


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

            Bug ID: 63518
           Summary: missing Wuninitialized warning independent of order of
                    arguments
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org

typedef int Timeout;

void wait(Timeout, bool);

void wait2(Timeout, bool);

bool setTimeout(Timeout &t)
{
  t = 5;
  return true;
}

void foo(void)
{
  Timeout t;
   wait(t, setTimeout(t));
}


void bar(void)
{
  Timeout t;
   wait2(setTimeout(t),t);
}

At least one of the both variants should give a warning. Ideally, both should.

Clang warns for the first variant.


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