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