[libvirt] regcomp warnings using Mingw64 toolchain

Bruno Haible bruno at clisp.org
Sun Jun 17 14:00:15 UTC 2012


Hi Paul,

Daniel P. Berrange wrote:
> While on x86_64-w64-mingw32 only I see:
> 
> 
> In file included from ../../../gnulib/lib/regex.c:69:0:
> ../../../gnulib/lib/regcomp.c: In function 'parse_dup_op':
> ../../../gnulib/lib/regcomp.c:2624:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> ../../../gnulib/lib/regcomp.c: In function 'mark_opt_subexp':
> ../../../gnulib/lib/regcomp.c:3859:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Obviously, the code assumes that 'long' has the same width as 'void*'.
For portability the cast to 'long' should better be replaced with a cast
to 'intptr_t'. This type is guaranteed to be defined by virtue of the
#include <stdint.h>
in regex_internal.h.

Bruno




More information about the libvir-list mailing list