Skip Menu |

This queue is for tickets about the Compress-Raw-Zlib CPAN distribution.

Report information
The Basics
Id: 123783
Status: open
Priority: 0/
Queue: Compress-Raw-Zlib

People
Owner: Nobody in particular
Requestors: JHI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Coverity #169263: Missing break in switch
inflate.c: 724 state->mode = TIME; CID 169263 (#1 of 1): Missing break in switch (MISSING_BREAK) unterminated_case: The case for value TIME is not terminated by a 'break' statement. 725 case TIME: 726 NEEDBITS(32); 727 if (state->head != Z_NULL) 728 state->head->time = hold; 729 if ((state->flags & 0x0200) && (state->wrap & 4)) 730 CRC4(state->check, hold); 731 INITBITS(); 732 state->mode = OS; fallthrough: The above case falls through to this one. 733 case OS:
On Wed Nov 29 01:13:52 2017, JHI wrote: Show quoted text
> inflate.c: > > 724 state->mode = TIME; > > CID 169263 (#1 of 1): Missing break in switch (MISSING_BREAK) > unterminated_case: The case for value TIME is not terminated by a > 'break' statement. > 725 case TIME: > 726 NEEDBITS(32); > 727 if (state->head != Z_NULL) > 728 state->head->time = hold; > 729 if ((state->flags & 0x0200) && (state->wrap & 4)) > 730 CRC4(state->check, hold); > 731 INITBITS(); > 732 state->mode = OS; > fallthrough: The above case falls through to this one. > 733 case OS:
This looks like another instance of the fallthrough warning highlighted in #123358. No idea why gcc 7 thought this code was fine while Coverity thought there was a problem. I assume that a comment of the form /* FALLTHROUGH */ is enough to silence coverity?
Subject: Re: [rt.cpan.org #123783] Coverity #169263: Missing break in switch
Date: Wed, 29 Nov 2017 22:44:24 +0200
To: bug-Compress-Raw-Zlib [...] rt.cpan.org, JHI [...] cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
On 11/29/17 18:36, Paul Marquess via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=123783 > > > On Wed Nov 29 01:13:52 2017, JHI wrote:
>> inflate.c: >> >> 724 state->mode = TIME; >> >> CID 169263 (#1 of 1): Missing break in switch (MISSING_BREAK) >> unterminated_case: The case for value TIME is not terminated by a >> 'break' statement. >> 725 case TIME: >> 726 NEEDBITS(32); >> 727 if (state->head != Z_NULL) >> 728 state->head->time = hold; >> 729 if ((state->flags & 0x0200) && (state->wrap & 4)) >> 730 CRC4(state->check, hold); >> 731 INITBITS(); >> 732 state->mode = OS; >> fallthrough: The above case falls through to this one. >> 733 case OS:
> > This looks like another instance of the fallthrough warning highlighted in #123358. > > No idea why gcc 7 thought this code was fine while Coverity thought there was a problem. > I assume that a comment of the form /* FALLTHROUGH */ is enough to silence coverity?
I think that's the de facto trick, yes. I think it wants explicit acknowledgement in the case of intentional fall-through. Show quoted text
>