lkml.org 
[lkml]   [1998]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectexplicit braces (gcc 2.8.0 and 2.1.80)
Date
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.



\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.026 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site