This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using varargs.h with C++ <iostream>
- To: carlo at runaway dot xs4all dot nl, jstern at citilink dot com
- Subject: Re: Using varargs.h with C++ <iostream>
- From: Josh Stern <jstern at citilink dot com>
- Date: Wed, 2 Sep 1998 09:26:29 -0500 (CDT)
- Cc: egcs at cygnus dot com
- Posted-Date: Wed, 2 Sep 1998 09:26:29 -0500 (CDT)
>| The <varargs.h> header does some work to #undef# conflicts
>| from <stdarg.h>, but the reverse doesn't seem to be true.
>| Also, <iostream> eventually includes <stdarg.h> through
>| streambuf.h
>|
>| This results in a situation where <varargs.h> will work
>| properly if it is included after <iostream> but not if it
>| is included before. Is this intended?
>|
>| (all of the above observations are made wrt the 8/24 snapshot)
>|
>|
>| - Josh
>|
>| jstern@citilink.com
>I think that the answer is that <varargs.h> is not compatible
>with <iostream> anyway.
>
><varargs.h> is not ANSI, its an old set of macros that have
>been replaced by <stdarg.h>. <varargs.h> is only there
>for backwards compatibility but should be avoided if possible.
Well yes, I know all of that. But in fact I was porting
someone elses crufty old code from SGI to Linux and they
did use <varargs.h> with <iostream> and I had to spend a bit
of time to figure out that it would work (without rewriting)
their program if <varargs.h> was included after <iostream>
but not before (which it originally was). If this asymmetry
is a consequence of some other important constraint, then fine.
But if it is just a missing #ifdef somewhere then it would be
nice to change. The <varargs.h> is distributed with egcs.
- Josh
jstern@citilink.com