Re: sparse-next and preview of 0.5.1-rc5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 20, 2017 at 6:35 PM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> You don't need a test case to *think* about the code or simply read
> the explanation I wrote here under.

It is very hard to reason the bug from the description. At most I can kind
of see how we get to that bad spot. It is very hard for me to think is there
other ways to fix it from the description. If you have the code, that is a lot
easier for me to understand the problem and how to approach the fix.

Thank you from your description below, I can construct a program
to show sparse-next has the "crazy programmer" and your patch
did not. I will take a closer look tomorrow.
> OK, it wasn't clear enough.
>
> It will be a few more days before I can access to my usual dev stuff
> where my tests and tests results are.

I have the test C code follow:

int *ptr;
int foo( int i)
{
int *p;
switch (i - i) {        // will be optimized to 0
case 0:                 // will be the simple branch
return 0;
case 1:                 // will be optimized away
do {            // will be an unreachable loop
   *p++ = 123;
} while (--i);
}
return 1;
}

Which will show "crazy programmer" in sparse-next but not your patch.

The crazy programmer error message deserve a better description.
I will take a closer look tomorrow. For now I am happy, I get what
I ask for.  A test program.

Thanks again.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux