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

Re: Problems compiling Citadel/UX



On Sun, Aug 15, 1999 at 09:16:53PM -0700, Eric G . Miller wrote:
>   Sounds like the code in question is trying to use a variable to
>   initialize another const variable.  This is not supported under ANSI
>   C, though I think gcc will allow it if the compiler flags are correct.
>   I think the -Wall flag could be what stops it.  Why don't you post the
>   beginning of the base64.c code up to the lines in question (26 & 27),
>   so a better determination, and possible fix can be suggested.
> 
> On Sun, Aug 15, 1999 at 11:03:14PM -0500, Michael Merten wrote:
> | 
> | [snip]
> | gcc -g -O2 -Wall -Wstrict-prototypes -I. -DHAVE_CONFIG_H -c base64.c
> | base64.c:26: initializer element is not constant
> | base64.c:27: initializer element is not constant
> | make: *** [base64.o] Error 1
> | 
> 


Ok, here's what I have:

=======================================================================
/*

	   Encode or decode file as MIME base64 (RFC 1341)

			    by John Walker
		       http://www.fourmilab.ch/

		This program is in the public domain.

*/

#define REVDATE "11th August 1997"

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

#define TRUE  1
#define FALSE 0

#define LINELEN 72		      /* Encoded line length (max 76) */

typedef unsigned char byte;	      /* Byte type */

static FILE *fi = stdin;	      /* Input file */
static FILE *fo = stdout;	      /* Output file */
static byte iobuf[256]; 	      /* I/O buffer */
static int iolen = 0;		      /* Bytes left in I/O buffer */
static int iocp = 256;		      /* Character removal pointer */
static int ateof = FALSE;	      /* EOF encountered */
static byte dtable[256];	      /* Encode / decode table */
static int linelength = 0;	      /* Length of encoded output line */
static char eol[] = "\r\n";           /* End of line sequence */
static int errcheck = TRUE;	      /* Check decode input for errors ? */
[snip]
==========================================================================

Does this help any?

Mike

[Private mail welcome, but no need to CC: me on list replies.]

--
Michael Merten  <mikemerten@yahoo.com>
          ---> Debian GNU/Linux Fan -- http://www.debian.org
          ---> CenLA-LUG Founder -- http://www.angelfire.com/la2/cenlalug
--
There are those who claim that magic is like the tide; that it swells and
fades over the surface of the earth, collecting in concentrated pools here
and there, almost disappearing from other spots, leaving them parched for
wonder.  There are also those who believe that if you stick your fingers
up your nose and blow, it will increase your intelligence.
     -- The Teachings of Ebenezum, Volume VII


Reply to: