1
0
镜像自地址 git://git.gnupg.org/gnupg.git 已同步 2025-06-30 22:27:56 +02:00

mpi: Suppress set-but-unused-variables warnings.

* include/types.h (GNUPG_GCC_ATTR_UNUSED): Define for gcc >= 3.5.
* mpi/mpih-div.c (mpihelp_divmod_1, mpihelp_mod_1): Mark dummy as
 unused.
* mpi/mpi-internal.h (UDIV_QRNND_PREINV): Mark _ql as unused.
--

Due to the use of macros and longlong.h, we use variables which are
only used by some architectures.  At least gcc 4.7.2 prints new
warnings about set but not used variables.  This patch silences them.
这个提交包含在:
Werner Koch 2014-08-20 13:25:17 +02:00
父节点 ecf2728230
当前提交 b89f57fe5d
共有 3 个文件被更改,包括 13 次插入3 次删除

查看文件

@ -143,4 +143,13 @@ struct string_list {
typedef struct string_list *STRLIST; typedef struct string_list *STRLIST;
typedef struct string_list *strlist_t; typedef struct string_list *strlist_t;
#if __GNUC__ > 2 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 )
# define GNUPG_GCC_ATTR_UNUSED __attribute__ ((unused))
#else
# define GNUPG_GCC_ATTR_UNUSED
#endif
#endif /*G10_TYPES_H*/ #endif /*G10_TYPES_H*/

查看文件

@ -157,7 +157,8 @@ typedef int mpi_size_t; /* (must be a signed type) */
*/ */
#define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \ #define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \
do { \ do { \
mpi_limb_t _q, _ql, _r; \ mpi_limb_t _ql GNUPG_GCC_ATTR_UNUSED; \
mpi_limb_t _q, _r; \
mpi_limb_t _xh, _xl; \ mpi_limb_t _xh, _xl; \
umul_ppmm (_q, _ql, (nh), (di)); \ umul_ppmm (_q, _ql, (nh), (di)); \
_q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \ _q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \

查看文件

@ -49,7 +49,7 @@ mpihelp_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
{ {
mpi_size_t i; mpi_size_t i;
mpi_limb_t n1, n0, r; mpi_limb_t n1, n0, r;
int dummy; int dummy GNUPG_GCC_ATTR_UNUSED;
/* Botch: Should this be handled at all? Rely on callers? */ /* Botch: Should this be handled at all? Rely on callers? */
if( !dividend_size ) if( !dividend_size )
@ -398,7 +398,7 @@ mpihelp_divmod_1( mpi_ptr_t quot_ptr,
{ {
mpi_size_t i; mpi_size_t i;
mpi_limb_t n1, n0, r; mpi_limb_t n1, n0, r;
int dummy; int dummy GNUPG_GCC_ATTR_UNUSED;
if( !dividend_size ) if( !dividend_size )
return 0; return 0;