Use GCC's -Wlogical-op if possible

Austin English austinenglish at gmail.com
Thu Jun 18 16:01:20 CDT 2009


On Thu, Jun 18, 2009 at 12:32 PM, Gerald Pfeifer<gerald at pfeifer.com> wrote:
> I verified this does not cause any extra warnings with GCC 4.4, whereas
> GCC 4.5 will become quite a bit more useful in that regard and thus help
> spot any issues.
>
> As with -Wtype-limits that I suggested last year, I pledge to keep close
> an eye on this and to address any issues proactively as part of my nightly
> test builds.
>
> Gerald
>
> ChangeLog:
> Use GCC's -Wlogical-op if possible.
>
> diff --git a/configure.ac b/configure.ac
> index bef311e..3f7a657 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1385,8 +1385,9 @@ 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([-Wwrite-strings])
> +  WINE_TRY_CFLAGS([-Wlogical-op])
>   WINE_TRY_CFLAGS([-Wtype-limits])
> +  WINE_TRY_CFLAGS([-Wwrite-strings])
>
>   dnl Check for noisy string.h
>   saved_CFLAGS="$CFLAGS"
>
>
>

Causes 106 more warnings on 4.3.3 of this sort:
tab.c:693: warning: logical ‘&&’ with non-zero constant will always
evaluate as true
cert.c:1627: warning: logical ‘||’ with non-zero constant will always
evaluate as true

-- 
-Austin



More information about the wine-devel mailing list