On 4.12.18 г. 14:22 ч., Adam Borowski wrote: > On Tue, Dec 04, 2018 at 01:17:04PM +0100, David Sterba wrote: >> On Fri, Nov 16, 2018 at 03:54:24PM +0800, Qu Wenruo wrote: >>> The only location is the following code: >>> >>> int level = path->lowest_level + 1; >>> BUG_ON(path->lowest_level + 1 >= BTRFS_MAX_LEVEL); >>> while(level < BTRFS_MAX_LEVEL) { >>> slot = path->slots[level] + 1; >>> ... >>> } >>> path->slots[level] = slot; >>> >>> Again, it's the stupid compiler needs some hint for the fact that >>> we will always enter the while loop for at least once, thus @slot should >>> always be initialized. >> >> Harsh words for the compiler, and I say not deserved. The same code >> pasted to kernel a built with the same version does not report the >> warning, so it's apparently a missing annotation of BUG_ON in >> btrfs-progs that does not give the right hint. > > It's be nice if the C language provided a kind of a while loop that executes > at least once... But it does, it's called: do { } while() >
- Re: [PATCH 8/9] btrfs-progs: Fix Wtype-limits warning Nikolay Borisov
- [PATCH 1/9] btrfs-progs: Makefile.extrawarn: Import cc-dis... Qu Wenruo
- [PATCH 7/9] btrfs-progs: Fix Wmaybe-uninitialized warning Qu Wenruo
- Re: [PATCH 7/9] btrfs-progs: Fix Wmaybe-uninitialized... Nikolay Borisov
- [PATCH v1.1 7/9] btrfs-progs: Fix Wmaybe-uninitialize... Qu Wenruo
- Re: [PATCH v1.1 7/9] btrfs-progs: Fix Wmaybe-unin... Nikolay Borisov
- Re: [PATCH 7/9] btrfs-progs: Fix Wmaybe-uninitialized... David Sterba
- Re: [PATCH 7/9] btrfs-progs: Fix Wmaybe-uninitial... Adam Borowski
- Re: [PATCH 7/9] btrfs-progs: Fix Wmaybe-unini... Nikolay Borisov
- Re: [PATCH 7/9] btrfs-progs: Fix Wmaybe-uninitial... Qu Wenruo
- [PATCH 6/9] btrfs-progs: Fix Wsuggest-attribute=format war... Qu Wenruo
- Re: [PATCH 6/9] btrfs-progs: Fix Wsuggest-attribute=f... Nikolay Borisov
- [PATCH 3/9] btrfs-progs: Makefile.extrawarn: Don't warn on... Qu Wenruo
- [PATCH 4/9] btrfs-progs: Fix Wempty-body warning Qu Wenruo
- Re: [PATCH 4/9] btrfs-progs: Fix Wempty-body warning Nikolay Borisov