bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Misapplied UNUSED parameter in current CVS snapshot


From: Michael Petch
Subject: Re: [Bug-gnubg] Misapplied UNUSED parameter in current CVS snapshot
Date: Sun, 29 Apr 2012 16:35:38 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120420 Thunderbird/12.0

On 29/04/2012 4:23 PM, Russ Allbery wrote:
> I had to apply the following patch to get the latest Debian package to
> build.  It looks like a slightly over-aggressive application of UNUSED
> tested against a build that didn't have an optional feature enabled.
>
> diff --git a/set.c b/set.c
> index 2bc8d63..6e3c786 100644
> --- a/set.c
> +++ b/set.c
> @@ -1548,7 +1548,7 @@ extern void CommandSetRNGFile( char *sz ) {
>      SetRNG( rngSet, rngctxSet, RNG_FILE, sz );
>  }
>
> -extern void CommandSetRNGBBS( char *UNUSED(sz) ) {
> +extern void CommandSetRNGBBS( char *sz ) {
>  #if HAVE_LIBGMP
>      SetRNG( rngSet, rngctxSet, RNG_BBS, sz );
>  #else
>

Might it be better to do it this way? So that the compiler warning for
both cases is suppressed? Although it's a bit ugly it covers the case
for HAVE_LIBGMP being used or not.

#if HAVE_LIBGMP
extern void CommandSetRNGBBS( char *sz ) {
    SetRNG( rngSet, rngctxSet, RNG_BBS, sz );
#else
extern void CommandSetRNGBBS( char *UNUSED(sz) ) {
    outputl( _("This installation of GNU Backgammon was compiled without
the "
               "Blum, Blum and Shub generator.") );
#endif /* HAVE_LIBGMP */
}


-- 
Michael Petch
CApp::Sysware Consulting Ltd.
OpenPGP FingerPrint=D81C 6A0D 987E 7DA5 3219 6715 466A 2ACE 5CAE 3304



reply via email to

[Prev in Thread] Current Thread [Next in Thread]