compilation error with WITHOUT_ED_CRYPTO

From: deeptech71 <deeptech71_at_gmail.com>
Date: Fri, 22 Mar 2013 15:55:02 +0100
/usr/src/bin/ed/cbc.c:76:13: error: unused variable 'bits'
       [-Werror,-Wunused-variable]
static char bits[] = {                  /* used to extract bits from a char */
             ^
/usr/src/bin/ed/cbc.c:80:12: error: unused variable 'pflag'
       [-Werror,-Wunused-variable]
static int pflag;                       /* 1 to preserve parity bits */
            ^
/usr/src/bin/ed/cbc.c:86:22: error: unused variable 'des_buf'
       [-Werror,-Wunused-variable]
static unsigned char des_buf[8];/* shared buffer for get_des_char/put_de...
                      ^
/usr/src/bin/ed/cbc.c:87:12: error: unused variable 'des_ct'
       [-Werror,-Wunused-variable]
static int des_ct = 0;          /* count for get_des_char/put_des_char */
            ^
/usr/src/bin/ed/cbc.c:88:12: error: unused variable 'des_n'
       [-Werror,-Wunused-variable]
static int des_n = 0;           /* index for put_des_char/get_des_char */
            ^

The obvious fix: widen the scope of ``#ifdef DES'':

Index: bin/ed/cbc.c
===================================================================
--- bin/ed/cbc.c	(revision 248614)
+++ bin/ed/cbc.c	(working copy)
_at__at_ -71,7 +71,6 _at__at_
  #ifdef DES
  static DES_cblock ivec;			/* initialization vector */
  static DES_cblock pvec;			/* padding vector */
-#endif
  
  static char bits[] = {			/* used to extract bits from a char */
  	'\200', '\100', '\040', '\020', '\010', '\004', '\002', '\001'
_at__at_ -79,13 +78,12 _at__at_
  
  static int pflag;			/* 1 to preserve parity bits */
  
-#ifdef DES
  static DES_key_schedule schedule;	/* expanded DES key */
-#endif
  
  static unsigned char des_buf[8];/* shared buffer for get_des_char/put_des_char */
  static int des_ct = 0;		/* count for get_des_char/put_des_char */
  static int des_n = 0;		/* index for put_des_char/get_des_char */
+#endif
  
  /* init_des_cipher: initialize DES */
  void
Received on Fri Mar 22 2013 - 13:55:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:36 UTC