All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Millan <jesse.millan@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] Fix gcc4 warning, idx may be used uninitialized
Date: Fri, 20 May 2005 19:51:57 +0000	[thread overview]
Message-ID: <428E3FDD.5000601@gmail.com> (raw)


So, the compiler should be able to tell that either one of the two cases
apply?

a: an assignment statement will be done on idx before its ever read

or

b: no assignment statement, control flow will never allow idx to be read

Alexey Dobriyan wrote:
> On Friday 20 May 2005 22:53, Jesse Millan wrote:
> 
>>This patch eliminates the warning that is generated when passing an
>>uninitialized variable to a function, and in that function it 'looks'
>>like you may read the contents.
>>
>>In this case, the address of a local variable 'idx' is passed to the
>>function bvec_alloc_bs(). Inside bvec_alloc_bs(), it is possible that
>>no value will be assigned to idx, in which case the function immediately
>>returns null and does not go on to read it. Human eyes can see that its
>>safe.
> 
> 
> I think this should go straight to http://gcc.gnu.org/bugzilla/enter_bug.cgi
> 

-- 
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Mobile: (503) 453-0748
GPG key: www.system-calls.com/gpg.php

grep --recursive --ignore-case 'SHOULD WORK' /usr/src/linux/* | wc
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2005-05-20 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-20 19:51 Jesse Millan [this message]
2005-05-22 18:33 ` [KJ] [PATCH] Fix gcc4 warning, idx may be used uninitialized Jesse Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=428E3FDD.5000601@gmail.com \
    --to=jesse.millan@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.