Re: [PATCH 1/2] dir.c: fix uninitialized memory warning
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 16, 2010, 23:13 UTC
- Message-ID
- <AANLkTim4SiuX=aWLeYXKpgvD+Nh1trH8qgf3V36iVa9w@mail.gmail.com>
- In-Reply-To
- <1284670403-90716-2-git-send-email-patnotz@gmail.com>
On Thu, Sep 16, 2010 at 20:53, Pat Notz <patnotz@gmail.com> wrote:
Show 18 quoted lines
> GCC 4.4.4 on MacOS warns about potential use of uninitialized memory.
>
> Signed-off-by: Pat Notz <patnotz@gmail.com>
> ---
> dir.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/dir.c b/dir.c
> index 133f472..d1e5e5e 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -232,7 +232,7 @@ int add_excludes_from_file_to_list(const char *fname,
> {
> struct stat st;
> int fd, i;
> - size_t size;
> + size_t size = 0;
> char *buf, *entry;What does the GCC warning say exactl? I.e. what line does it complain about?
Maybe this is a logic error introduced in v1.7.0-rc0~25^2? I haven't checked.