Messages in this thread | | | From | "Mike Black" <> | Subject | explicit braces (gcc 2.8.0 and 2.1.80) | Date | Wed, 21 Jan 1998 12:54:25 -0500 |
| |
With gcc 2.8.0 I'm getting quite a few of these:
ext2/truncate.c: In function `trunc_indirect': ext2/truncate.c:187: warning: suggest explicit braces to avoid ambiguous `else' ext2/truncate.c: In function `trunc_dindirect': ext2/truncate.c:249: warning: suggest explicit braces to avoid ambiguous `else' ext2/truncate.c: In function `trunc_tindirect': ext2/truncate.c:310: warning: suggest explicit braces to avoid ambiguous `else'
And indeed:
if (i >= addr_per_block) if (ind_bh->b_count != 1) retry = 1; else { tmp = in_inode ? *p : le32_to_cpu(*p); *p = in_inode ? 0 : cpu_to_le32(0); inode->i_blocks -= blocks; mark_inode_dirty(inode); ext2_free_blocks (inode, tmp, 1); bforget(ind_bh); ind_bh = NULL; }
else clause is obvious by indentation but should have braces around the outer "if" to ensure binding with the inner "if". Binding is assumed on the inner-most "if" but can be confusing. I haven't checked all the warnings so I hope there aren't any big problems looming here.
| |