This warning has been annoying me for quite some time:
        ../fs/ufs.c: In function `grub_ufs_find_file':
        ../fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
        ../fs/ufs.c:474: warning: shadowed declaration is here
        ../fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
        ../fs/ufs.c:474: warning: shadowed declaration is here

The line in question:
    } while (pos < grub_le_to_cpu32 (INODE_SIZE (data)));

This warning coincidentally calls attention to a bug that would otherwise be unnoticed.

From a look at INODE_SIZE, you can see that "data" is being swapped twice. On big-endian systems it will be done twice; on wrong-endian it won't happen at all. Based on that, and other users of INODE_SIZE, I'm going to remove the extra swap, but I would like to know how this code can be tested.

-Hollis



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to