The compiler warning is bogus. Your patch pessimizes the code; IIRC it
can cause runtime-initialization of the pointer.
Load-time relocation, to be precise.
Paolo
On 11/02/2009 08:17 PM, Eric Blake wrote:
Even better to post a
GCC patch to avoid emitting this warning.
I have no idea where to patch that, but I guess I could go ahead and submit the
bug report.
I'd say the real bug is that it doesn't emit the warning for a char *const.
Paolo
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
* Eric Blake wrote on Mon, Nov 02, 2009 at 08:17:36PM CET:
Ralf Wildenhues Ralf.Wildenhues at gmx.de writes:
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.
Like
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -DLTDLOPEN=libltdlc
-DLT_CONFIG_H=config.h -DLTDL -I. -I. -Ilibltdl -I./libltdl
- -I./libltdl -O2 -Wall -MT libltdlc_la-ltdl.lo -MD -MP -MF
.deps/libltdlc_la-ltdl.Tpo -c ltdl.c -fPIC -DPIC -o