From: David Binderman Date: 2013-10-10T15:59:04+00:00 Subject: [ruby-core:57816] Re: ruby-2.0.0-p247siphash.c:443: bug report ________________________________ > Date: Thu, 10 Oct 2013 11:43:27 -0400 > From: charliesome@ruby-lang.org > To: ruby-core@ruby-lang.org > Subject: [ruby-core:57815] Re: ruby-2.0.0-p247siphash.c:443: bug report > > It looks like the case fallthrough here is intended. Would a /* fallthrough */ comment help those less than completely familiar with the code ? Regards David Binderman > > On Thursday, 10 October 2013 at 10:43 AM, David Binderman wrote: > > Hello there, > > I just ran the static analysis tool cppcheck over the source code > of ruby-2.0.0-p247 > > It said > > [siphash.c:443] -> [siphash.c:445]: (warning) Variable 'last' is > reassigned a value before the old one has been used. 'break;' missing? > [siphash.c:445] -> [siphash.c:447]: (warning) Variable 'last' is > reassigned a value before the old one has been used. 'break;' missing? > [siphash.c:447] -> [siphash.c:460]: (warning) Variable 'last' is > reassigned a value before the old one has been used. 'break;' missing? > [siphash.c:460] -> [siphash.c:462]: (warning) Variable 'last' is > reassigned a value before the old one has been used. 'break;' missing? > [siphash.c:462] -> [siphash.c:464]: (warning) Variable 'last' is > reassigned a value before the old one has been used. 'break;' missing? > > Source code is > > switch (len % sizeof(uint64_t)) { > case 7: > OR_BYTE(6); > case 6: > OR_BYTE(5); > case 5: > OR_BYTE(4); > > Suggest add some break statements. > > Regards > > David Binderman >