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

Amitay Isaacs amitay at ozlabs.org
Wed Jun 19 13:15:46 AEST 2019


../../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];
 
-- 
2.21.0



More information about the Pdbg mailing list