Wine: Use the compiler option -Wpointer-arith if available.
Michael Stefaniuc
mstefani at redhat.com
Sun Apr 17 15:09:40 CDT 2011
On 04/17/2011 01:19 AM, Gerald Pfeifer wrote:
> GCC provides an option -Wpointer-arith and describes it as follows:
>
> Warn about anything that depends on the "size of" a function type
> or of `void'. GNU C assigns these types a size of 1, for
> convenience in calculations with `void *' pointers and pointers to
> functions.
>
> This does not trigger on my Wine builds, but then we should not invoke
Of course it doesn't triggers in Wine as -Wpointer-arith is already
enabled. I made heavy use of that when I did my pointer cast killing
spree a few years ago.
> sizeof(void) or sizeof(some_function). ;-) It should help catch any
> such bad future uses of sizeof.
>
> Gerald
> ---
> configure.ac | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 6047744..0ae6625 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1715,6 +1715,7 @@ then
> WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
> WINE_TRY_CFLAGS([-fno-strict-aliasing])
> WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
> + WINE_TRY_CFLAGS([-Wpointer-arith])
> WINE_TRY_CFLAGS([-Wstrict-prototypes])
> WINE_TRY_CFLAGS([-Wtype-limits])
> WINE_TRY_CFLAGS([-Wunused-but-set-parameter])
bye
michael
More information about the wine-devel
mailing list