Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2013 15:55:02 +0100
From:      deeptech71 <deeptech71@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   compilation error with WITHOUT_ED_CRYPTO
Message-ID:  <514C70C6.2070603@gmail.com>

next in thread | raw e-mail | index | archive | help
/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)
@@ -71,7 +71,6 @@
  #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'
@@ -79,13 +78,12 @@
  
  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?514C70C6.2070603>