Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332532

Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings

From Jeff Merkey <linux.mdb@gmail.com>
Newsgroups linux.kernel
Subject Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings
Date 2016-02-12 06:00 +0100
Message-ID <r1dZL-25w-3@gated-at.bofh.it> (permalink)
References <r0PXr-2XH-1@gated-at.bofh.it> <r106w-1qh-69@gated-at.bofh.it> <r140q-40Y-11@gated-at.bofh.it> <r1bXX-Lj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2/11/16, Theodore Ts'o <tytso@mit.edu> wrote:
> On Thu, Feb 11, 2016 at 11:12:12AM -0700, Jeff Merkey wrote:
>>
>> That's good to know, they could be false positives, but it was kind of
>> wierd behavior caused by that macro.
>
> If it is true, it sounds more like a compiler bug to me.  Any
> statements a BUG() call are unreachable.  If the compiler assumes that
> in the case of:
>
> 	if (a)
> 	        BUG();
> 	printf("foo bar\n");
> 	
> That the printf is not reachable, that's a compiler bug.  And not a
> problem in the BUG() macro.
>
> It might be that it's worthwhile to use other static code analysis
> tools.  Many people will look at warnings from Coverity and clang to
> find potential problems, since these tend to find more warnings than
> just using gcc.  The problem with some of these, including Coverity,
> is that they can be __too__ noisy, and if 90% of the warnings are
> false positives, most people won't take the time to weed out several
> dozen bogus warnings to find the one good one.
>

Did you remove the calls to unreachable() before you did the build?
Remove the call to that function from the BUG() macro, then do a
build, and tell me I am seeing things.

Jeff

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-11 04:20 +0100
  Re: [BUG REPORT] use of unreachable() masks uninitialized variables  warnings Theodore Ts'o <tytso@mit.edu> - 2016-02-11 15:10 +0100
    Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-11 19:20 +0100
      Re: [BUG REPORT] use of unreachable() masks uninitialized variables  warnings Theodore Ts'o <tytso@mit.edu> - 2016-02-12 03:50 +0100
        Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-12 05:20 +0100
        Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-12 05:30 +0100
          Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-12 05:50 +0100
        Re: [BUG REPORT] use of unreachable() masks uninitialized variables warnings Jeff Merkey <linux.mdb@gmail.com> - 2016-02-12 06:00 +0100

csiph-web