-------- Original Message --------
Subject: [PATCH 1/1] btrfs-progs: fix compiler warning
From: Christian Hesse <m...@eworm.de>
To: linux-btrfs@vger.kernel.org
Date: 2014年06月03日 19:29
gcc 4.9.0 gives a warning: array subscript is above array bounds
Checking for "greater or equal" instead of just "equal" fixes this.
Signed-off-by: Christian Hesse <m...@eworm.de>
---
cmds-restore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-restore.c b/cmds-restore.c
index 96b97e1..534a49e 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -169,7 +169,7 @@ again:
break;
}
- if (level == BTRFS_MAX_LEVEL)
+ if (level >= BTRFS_MAX_LEVEL)
return 1;
slot = path->slots[level] + 1;
Also I faied to reproduce the bug.
Using gcc-4.9.0-3 from Archlinux core repo.
It seems to be related to default gcc flags from distribution?
Thanks,
Qu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html