busybox
Variable *gdp is only used if EXT2FS_ENABLE_SWAPFS is enabled.
Bug fixed by commit 0301ffab3d9
Type | UnusedVariable |
Config | !EXT2FS_ENABLE_SWAPFS (1st degree) |
C-features | Structs |
Fix-in | mapping |
Location | e2fsprogs/ |
#include <stdio.h> void ext2fs_open2(void) { char *gdp; #ifdef EXT2FS_ENABLE_SWAPFS gdp = "group_desc"; for (int j = 0; j < 10; j++) { printf("%c\n", (*gdp)++); } #endif } void ext2fs_open(void) { ext2fs_open2(); } int main(int argc, char** argv) { ext2fs_open(); return 0; }
diff --git a/simple/0301ffa.c b/simple/0301ffa.c --- a/simple/0301ffa.c +++ b/simple/0301ffa.c @@ -3,7 +3,9 @@ void ext2fs_open2(void) { +#ifdef EXT2FS_ENABLE_SWAPFS char *gdp; +#endif #ifdef EXT2FS_ENABLE_SWAPFS gdp = "group_desc";
#include <stdio.h> int main(int argc, char** argv) { // ext2fs_open(); char *gdp; #ifdef EXT2FS_ENABLE_SWAPFS gdp = "group_desc"; for (int j = 0; j < 10; j++) { printf("%c\n", (*gdp)++); } #endif return 0; }
. call /ext2fs/openfs.c:62:ext2fs_open() .. call /ext2fs/openfs.c:81:ext2fs_open2() ... 92: struct ext2_group_desc *gdp; ... [EXT2FS_ENABLE_SWAPFS] 279: gdp = dest;