coreutils
[Top][All Lists]
Advanced

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

Re: more compile warnings with new factor


From: Torbjorn Granlund
Subject: Re: more compile warnings with new factor
Date: Tue, 23 Oct 2012 08:53:27 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix)

Pádraig Brady <address@hidden> writes:

  If I manually undef HAVE_GMP at the top of factor.c, then...
  
  $ make src/factor.o
  src/factor.c:154:0: error: macro "__GMP_GNUC_PREREQ" is not used 
[-Werror=unused-macros]
  
It is used by some configs in longlong.h.  It cannot be removed unless
you fork longlong.h.

  $ make CFLAGS=-m32 src/factor.o
  src/factor.c: In function 'factor_using_division':
  src/factor.c:755:33: error: variable 'lo' set but not used 
[-Werror=unused-but-set-variable]
  src/factor.c: In function 'mulredc':
  src/factor.c:945:28: error: variable 'tl' set but not used 
[-Werror=unused-but-set-variable]
  src/factor.c: In function 'mulredc2':
  src/factor.c:965:28: error: variable 'p0' set but not used 
[-Werror=unused-but-set-variable]
  src/factor.c: In function 'prime2_p':
  src/factor.c:1323:17: error: variable '_p0' set but not used 
[-Werror=unused-but-set-variable]
  src/factor.c: In function 'factor_using_pollard_rho2':
  src/factor.c:1579:11: error: variable '_p0' set but not used 
[-Werror=unused-but-set-variable]
  src/factor.c: In function 'factor_using_squfof':
  src/factor.c:2146:19: error: variable '_p0' set but not used 
[-Werror=unused-but-set-variable]
  
  The above point to redundant processing in umul_ppmm()
  (or at least our use of it).
  
The code sometimes needs the upper half of a product, but umul_ppmm
generates the full product as two halves.  You could insert bogus
dependencies on the low half, most likely making generated code worse.
Or remove the bogus warning.

  src/factor.c: At top level:
  src/factor.c:151:0: error: macro "ASSERT" is not used [-Werror=unused-macros]
  src/factor.c:154:0: error: macro "__GMP_GNUC_PREREQ" is not used 
[-Werror=unused-macros]
  
I fail to understand how anybody can regard an unused macro as an
*error*.
  
  I'll clean up these tomorrow.

Aren't this Draconian options ("ask the compiler to nag about everything
it can, then treat nagging as errors in the code") self-defeating?  You
need to avoid natural ways of writing things, and instead go for
contorted solutions.  I spent a few hours trying to satisfy your demands
in this area, and I am sure you maintainers have spent a lot of time on
it.

I for one prefer to spend my time on improving GNU, not define an
artifical goal like this one, and work on satifying that.

-- 
Torbjörn



reply via email to

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