Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: H J Lu <hjl@zoom.com>
Subject: Re: &lt;varargs.h&gt; vs. &lt;stdarg.h&gt;; &lt;gnu/types.h&gt;
Date: Tue, 23 Jan 1996 08:27:46 -0800 (PST)	[thread overview]
Message-ID: <199601231627.IAA02218@aurora.romoidoy.com> (raw)
In-Reply-To: <m0teTW4-000Bj2C@tartan>

> 
> Is it supposed to be ok for a program to include both varargs.h and stdarg.h?
> (Never mind for the moment that this is not a good idea--I've already fixed
> the code.)  The only reason I'm asking is that the following comment
> in varargs.h makes me think that gcc would turn off stdarg.h, i.e. skip it:
> 
>     /* Record that this is varargs.h; this turns off stdarg.h.  */
> 
> I have a file (mosaic/libhtmlw/HTML-PSformat.c) that includes
> varargs.h first and includes stdarg.h later.  This is the error I get:
> 
> In file included from /usr/lib/gcc-lib/alpha-linux/2.7.0/include/stdarg.h:36,
>                  from /motif2/X11/Xm/VaSimpleP.h:42,
>                  from HTML-PSformat.c:76:
> /usr/lib/gcc-lib/alpha-linux/2.7.0/include/va-alpha.h:42:
>     warning: `va_start' redefined
> /usr/lib/gcc-lib/alpha-linux/2.7.0/include/va-alpha.h:32:
>     warning: this is the location of the previous definition
> HTML-PSformat.c:273: macro `va_start' used with just one arg
> 
> So it doesn't look like stdarg.h got turned off.
> 

The processing procedures are different for <varargs.h> and
<stdarg.h>. If you include <varargs.h>, it means you want to
use the old K&R C style for ....

> 
> <gnu/types.h> has a couple of "ifdef __linux__" sections,
> but "__linux__" is not in the gcc predefs, only "linux".
> This causes problems with __FD_SET and friends.

If you do a "gcc -v -c foo.c" under x86, you will see
__linux__ is defined. It is configued in the gcc source.

-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

      reply	other threads:[~1996-01-23 16:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-22 21:11 &lt;varargs.h&gt; vs. &lt;stdarg.h&gt;; &lt;gnu/types.h&gt; Craig Groeschel
1996-01-23 16:27 ` H J Lu [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox