All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Adrian Bunk <bunk@stusta.de>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] rocksdb: Fix compile error for DEBUG_BUILD
Date: Thu, 9 Jan 2020 16:30:41 +0800	[thread overview]
Message-ID: <aae96c30-db44-b4ef-9c4c-ec44088e18ee@windriver.com> (raw)
In-Reply-To: <20200109081406.GA6849@localhost>



On 1/9/20 4:14 PM, Adrian Bunk wrote:
> On Thu, Jan 09, 2020 at 03:13:57PM +0800, Robert Yang wrote:
>>
>>
>> On 1/8/20 5:27 PM, Adrian Bunk wrote:
>>> On Wed, Jan 08, 2020 at 02:09:03PM +0800, Robert Yang wrote:
>>>> Fixed do_compile error when DEBUG_BUILD = "1":
>>>> db/write_thread.cc:183:14: error: 'state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>>>> ...
>>>
>>> -Og warnings are not 100% reliable, and in general -Werror is
>>> problematic for distributions.
>>>
>>> Does building with -DFAIL_ON_WARNINGS=OFF fix this problem?
>>
>> Yes, it works.
>>
>> I think that the correct way to fix it is initialize it rather than ignore
>> the error.
> 
> Is the error a bug in the code, or is it a bogus warning from the compiler?
> 
> When the warning happens only with -Og this is a known case of bogus
> warnings in gcc, and the correct way to fix it is to ignore the bogus
> warning.

I checked the code, it won't be used before uninitialized. But I still think
that assign it an initial value is better than ignore the warnings, there
  might be other vars really have this issue.

// Robert

> 
>> // Robert
> 
> cu
> Adrian
> 


  reply	other threads:[~2020-01-09  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08  6:09 [PATCH] rocksdb: Fix compile error for DEBUG_BUILD Robert Yang
2020-01-08  9:27 ` Adrian Bunk
2020-01-09  7:13   ` Robert Yang
2020-01-09  7:23     ` Khem Raj
2020-01-09  8:14     ` Adrian Bunk
2020-01-09  8:30       ` Robert Yang [this message]
2020-01-09  9:01         ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aae96c30-db44-b4ef-9c4c-ec44088e18ee@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=bunk@stusta.de \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.