This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Make stdio.h work with alpha gcc <= 2.95.x (was Re: Problem with va-list on axp.)


On Mon, Jul 09, 2001 at 02:14:41PM +0200, Andreas Jaeger wrote:
> Lukas Dobrek <dobrek@itp.uni-hannover.de> writes:
> 
> >> That looks like a compiler bug and it seems to be fixed in newer GCC
> >> releases.
> > 
> > Which exactly version you mean? I have gcc-2.95.3 the newer as far as I
> > know is gcc-3.0. I would rather like to avoid this upgrade.
> 
> It should be fixed in 3.0 - and I understand your concerns.  But since
> it's a bug in GCC and not glibc, the glibc developers can't help you.

It is actually not that black and white.
If you look at libio/stdio.h, Ulrich uses there detailed knowledge about how
stdarg.h/vararg.h is implemented to avoid including stdarg.h which would
pollute namespace.

> You might want to look at GCC 3.0 and backport the fix to 2.95.3,

GCC 3.0 varargs have almost nothing in common with 2.95.x varargs, the
former is done using special builtins, the latter was done in a bunch of
architecture specific headers using some help from the compiler.
So, backporting this is not as trivial as you think.
The following patch might help, simply by making _XOPEN_SOURCE alpha headers
not namespace clean with gcc <= 2.95.x. IMHO it is better than making it not
work at all. Another alternative would be to use #if __GNUC_PREREQ (2,96)
instead, but my point is why to punish non-alpha platforms where it works
well.

2001-07-09  Jakub Jelinek  <jakub@redhat.com>

	* libio/stdio.h: Include stdarg.h for gcc <= 2.95.x on alpha.

--- libc/libio/stdio.h.jj	Mon Jul  9 14:28:37 2001
+++ libc/libio/stdio.h	Mon Jul  9 14:32:43 2001
@@ -65,7 +65,7 @@ typedef struct _IO_FILE __FILE;
 #include <libio.h>
 
 #ifdef __USE_XOPEN
-# ifdef __GNUC__
+# if defined(__GNUC__) && (__GNUC_PREREQ (2,96) || ! defined (__alpha__))
 #  ifndef _VA_LIST_DEFINED
 typedef _G_va_list va_list;
 #   define _VA_LIST_DEFINED


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]