[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoid gcc compiler warning
From: |
Ralf Wildenhues |
Subject: |
Re: avoid gcc compiler warning |
Date: |
Fri, 26 Sep 2008 18:03:40 +0200 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hi Eric,
* Eric Blake wrote on Fri, Sep 26, 2008 at 05:57:06PM CEST:
> When I upgraded from 3.4.4 to gcc 4.3.2, I started seeing these warnings on
> cygwin:
>
> cc1: warnings being treated as errors
> ../ltdl/loaders/loadlibrary.c: In function 'vm_open':
> ../ltdl/loaders/loadlibrary.c:159: error: the address of 'wpath' will always
> evaluate as 'true'
>
> Applying this trivial patch (wchar was declared as an array):
This patch is not really defensive programming, right?
(The declaration is a screenful away, and we've had unwary
copying of code from one function to another before.)
Cheers,
Ralf
> From: Eric Blake <address@hidden>
> Date: Fri, 26 Sep 2008 09:43:04 -0600
> Subject: [PATCH] Avoid gcc warning.
>
> * libltdl/loaders/loadlibrary.c (vm_open): Don't check for array
> being a NULL pointer.
> - len = LT_STRLEN (wpath);
> + len = strlen (wpath);