From: hlu@luke.eecs.wsu.edu (H.J. Lu) Subject: Re: porting xvnews... varargs problem in GCC 2.3.3 Date: 1 Feb 1993 16:08:55 GMT
In article <1993Feb1.092706.24101@cheshire.oxy.edu> rafetmad@cheshire.oxy.edu (David Giller) writes:
>
>I've been trying to compile xvnews, a news reader for Xview, using
>xview3L3. I've run into a little problem. Aside from the filenames
>not fitting in the 14-char limit (a negligible problem) I've run into
>the following problem:
>
>gio.c: In function `gio_printf':
>gio.c:989: `__builtin_va_alist' undeclared (first use this function)
>gio.c:989: (Each undeclared identifier is reported only once
>gio.c:989: for each function it appears in.)
>
This code is wrong. See below. If you want to use ANSI C, you have
to follow through.
>Here is the offending section of code:
>
>#include <stdio.h>
>#include <ctype.h>
>#include <sys/param.h>
>#include <sys/types.h>
>#include <sys/stat.h>
>#include <errno.h>
>#include <string.h>
>#include <varargs.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
>#include <malloc.h>
>#include "guide.h"
>#include "gio.h"
>
>[......]
>
>/*
> * fprintf to the current output file.
> */
>#ifdef __STDC__
>void
>gio_printf(char *fmt, ...)
>#else
>void
>gio_printf(fmt, va_alist)
> char *fmt;
> va_dcl
>#endif
>{
> va_list args;
>
> if (Newline)
> fputs(Indent, Outp);
>
> va_start(args);
#ifdef __STDC__
va_start(args, fmt);
#else
va_start(args);
#endif
> Newline = fmt[strlen(fmt) - 1] == '\n';
> vfprintf(Outp, fmt, args);
> va_end(args);
>}
>
>
>Can anyone shed some light on the situation? I have no experience
>with C varargs.
>
>Setup: latest SLS, imake fixed, xview3L3, GCC 2.3.3.
>
>The package is on sunsite.unc.edu:/pub/X11/Openlook/xview.tar.Z
>
>Thanks for all pointers...
>
>--
H.J.