Hi,

On Thu, Mar 15, 2018 at 04:43:29PM +0500, ???? ??????? wrote:
> Hello,
> 
> small issue (no real impact) identified by cppcheck

> From 733d99f42d93898232bb8c3c953b662ee889c034 Mon Sep 17 00:00:00 2001
> From: Ilya Shipitsin <[email protected]>
> Date: Thu, 15 Mar 2018 16:38:38 +0500
> Subject: [PATCH] CLEANUP: remove duplicate code in src/dns.c
> 
> issue was identified by cppcheck
> 
> [src/dns.c:2037] -> [src/dns.c:2041]: (warning) Variable 'appctx->st2' is 
> reassigned a value before the old one has been used. 'break;' missing?
> ---
>  src/dns.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/dns.c b/src/dns.c
> index 280bc155..c49a4c6d 100644
> --- a/src/dns.c
> +++ b/src/dns.c
> @@ -2034,9 +2034,6 @@ static int 
> cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
>                       return 0;
>               }
>  
> -             appctx->st2 = STAT_ST_FIN;
> -             /* fall through */
> -

Thanks, however I'll keep the comment, because the most recent gcc versions
now have implemented a shitty feature consisting in reading your comments
and emitting warnings if they don't find such a comment in a "case"
statement missing a break! Given that these people don't use C anymore,
they probably feel like it's safe to break it for everyone else. So I'll
take your patch and adapt it a bit.

Thanks,
Willy

>       default:
>               appctx->st2 = STAT_ST_FIN;
>               return 1;
> -- 
> 2.14.3
> 


Reply via email to