[Pdbg] [PATCH 2/6] libpdbg: Fix clang warning -Wself-assign

Alistair Popple alistair at popple.id.au
Tue Jul 2 11:59:33 AEST 2019


Reviewed-by: Alistair Popple <alistair at popple.id.au>

On Wednesday, 19 June 2019 1:15:46 PM AEST Amitay Isaacs wrote:
> ../../src/optcmd.c:90:17: error: explicitly assigning value of variable of
> type 'int' to itself [-Werror,-Wself-assign] for (arg_count = arg_count;
> arg_count < total_arg_count; arg_count++) {
> 
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  src/optcmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/optcmd.c b/src/optcmd.c
> index f6d2690..c563248 100644
> --- a/src/optcmd.c
> +++ b/src/optcmd.c
> @@ -87,7 +87,7 @@ optcmd_cmd_t *optcmd_parse(struct optcmd_cmd *cmd, const
> char *argv[], int argc, }
>  	}
> 
> -	for (arg_count = arg_count; arg_count < total_arg_count; arg_count++) {
> +	for (; arg_count < total_arg_count; arg_count++) {
>  		/* Process default positional arguments */
>  		struct optcmd_arg *arg = &args[arg_count];




More information about the Pdbg mailing list