Re: Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Date: 2013-11-09 22:17:13
Message-ID: 1384035433.12845.YahooMailNeo@web162904.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:

>>  int warning_test(int a);
>>  int warning_test(int a)
>>  {
>>      int result;
>>
>>      if (a == 1)
>>          result = 1;
>>
>>      return result;
>>  }

I had to file separate bug reports for gcc and clang.  I have
already gotten a response on the clang bug report using the above
test code.  It was closed with this response:

Fixed from clang 3.3
warning_test.c:8:6: warning: variable 'result' is used uninitialized whenever 'if' condition is
      false [-Wsometimes-uninitialized]
        if (a == 1)
            ^~~~~~
warning_test.c:11:9: note: uninitialized use occurs here
        return result;
              ^~~~~~
warning_test.c:8:2: note: remove the 'if' if its condition is always true
        if (a == 1)
        ^~~~~~~~~~~
warning_test.c:6:14: note: initialize the variable 'result' to silence this warning
        int                    result;
                                      ^
                                      = 0

** Changed in: clang (Ubuntu)
      Status: New => Fix Released

I take that to say that the bug will be fixed in clang version 3.3,
which is not available in any production release of Ubuntu.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Kevin Grittner 2013-11-09 23:34:32 Re: Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Previous Message Kevin Grittner 2013-11-09 22:00:12 Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Singer 2013-11-09 22:36:49 Re: logical changeset generation v6.5
Previous Message Kevin Grittner 2013-11-09 22:00:12 Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value