* [patch 7/7] Fix misleading gcc4 warning: (160) offset and block may be used uninitialized in this function
@ 2005-06-20 21:57 domen
2005-06-21 7:17 ` Jörn Engel
0 siblings, 1 reply; 2+ messages in thread
From: domen @ 2005-06-20 21:57 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel, Jesse Millan, domen
[-- Attachment #1: gcc4-fs_isofs_namei.c --]
[-- Type: text/plain, Size: 1055 bytes --]
From: Jesse Millan <jessem@cs.pdx.edu>
This warning appears to be a false alarm.
This patch eliminates the warning that 'offset' and 'block' may be used
uninitialized. The compiler does not like the conditional initialization
of the two variables in the function isofs_find_entry().
In isofs_find_entry(), 'offset' and 'block' are referred to as
'block_rv' and 'offset_rv' respectively and are now initialized
unconditionally to zero.
Signed-off-by: Jesse Millan <jessem@cs.pdx.edu>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
namei.c | 2 ++
1 files changed, 2 insertions(+)
Index: quilt/fs/isofs/namei.c
===================================================================
--- quilt.orig/fs/isofs/namei.c
+++ quilt/fs/isofs/namei.c
@@ -57,6 +57,8 @@ isofs_find_entry(struct inode *dir, stru
unsigned long block, f_pos, offset, block_saved, offset_saved;
struct buffer_head * bh = NULL;
struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb);
+ *block_rv = 0;
+ *offset_rv = 0;
if (!ISOFS_I(dir)->i_first_extent)
return 0;
--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 7/7] Fix misleading gcc4 warning: (160) offset and block may be used uninitialized in this function
2005-06-20 21:57 [patch 7/7] Fix misleading gcc4 warning: (160) offset and block may be used uninitialized in this function domen
@ 2005-06-21 7:17 ` Jörn Engel
0 siblings, 0 replies; 2+ messages in thread
From: Jörn Engel @ 2005-06-21 7:17 UTC (permalink / raw)
To: domen; +Cc: viro, linux-fsdevel, Jesse Millan
On Mon, 20 June 2005 23:57:06 +0200, domen@coderock.org wrote:
>
> This warning appears to be a false alarm.
>
> This patch eliminates the warning that 'offset' and 'block' may be used
> uninitialized. The compiler does not like the conditional initialization
> of the two variables in the function isofs_find_entry().
>
> In isofs_find_entry(), 'offset' and 'block' are referred to as
> 'block_rv' and 'offset_rv' respectively and are now initialized
> unconditionally to zero.
In this case, I actually like the warning. The code is mildly
obfuscated and some cleanup wouldn't hurt. Silencing the warning
doesn't make the code any better, so I'd rather keep it until some
real changes happen.
Jörn
--
To announce that there must be no criticism of the President, or that we
are to stand by the President, right or wrong, is not only unpatriotic
and servile, but is morally treasonable to the American public.
-- Theodore Roosevelt, Kansas City Star, 1918
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-06-21 7:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-20 21:57 [patch 7/7] Fix misleading gcc4 warning: (160) offset and block may be used uninitialized in this function domen
2005-06-21 7:17 ` Jörn Engel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).