libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avoid compiler warning


From: Ralf Wildenhues
Subject: Re: avoid compiler warning
Date: Mon, 2 Nov 2009 20:08:56 +0100
User-agent: Mutt/1.5.20 (2009-08-09)

Hi Eric,

* Eric Blake wrote on Mon, Nov 02, 2009 at 08:00:43PM CET:
> I'm seeing this when compiling with -Wall:
> 
> | libltdl/ltdl.c: In function ‘try_dlopen’:
> | libltdl/ltdl.c:1267: error: the address of ‘libext’ will always evaluate 
> as ‘true’
> 
> The problem is that LT_STRLEN is checking for null pointers, but the address 
> of 
> an array can never be null.  But using a const * instead of an array silences 
> the warning.  OK to commit this?

The compiler warning is bogus.  Your patch pessimizes the code; IIRC it
can cause runtime-initialization of the pointer.

OK to commit a patch to change this to strlen.  Even better to post a
GCC patch to avoid emitting this warning.

Thanks!
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]