[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] diffseq: avoid compiler warning when !USE_HEURISTIC
From: |
Eric Blake |
Subject: |
Re: [PATCH] diffseq: avoid compiler warning when !USE_HEURISTIC |
Date: |
Fri, 12 Dec 2014 12:05:48 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 12/09/2014 08:50 PM, Daiki Ueno wrote:
> Hello,
>
> I got a minor warning when compiling gettext, which uses the 'diffseq'
> module without USE_HEURISTIC set.
>
> diffseq.h: In function 'diag':
> diffseq.h:189:12: warning: variable 'big_snake' set but not used
> [-Wunused-but-set-variable]
> +++ b/lib/diffseq.h
> @@ -186,7 +186,9 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
> for (c = 1;; ++c)
> {
> OFFSET d; /* Active diagonal. */
> +#ifdef USE_HEURISTIC
> bool big_snake = false;
Rather than using #ifdef everywhere, can you test if:
bool big_snake _GL_UNUSED = false;
does the trick of shutting up the compiler? If so, a one-line fix is a
lot more palatable.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature