This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch to libstdc++]: cheaders=c cstdarg/stdarg.h namespacecontrol


RE: http://gcc.gnu.org/ml/gcc-patches/2002-09/msg01584.html

I retract this patch submssion.  It creates problems with multiple
includes of  stdarg.h (eg, the first time with __need__va_list, the
second time without).   A local solution can be obtained by fixing the
target C runtime headers, using an additional stdarg.h layer to put  the
ginclude'd typedefs into  their own namespace and then inject only
va_list int std.

Danny

> The include/c/std_cstdarg.h and include/c-compatibility/stdarg.h pair
of
> headers
> makes it difficult to keep std::va_list out of global namespace.
>
> For example, with mingw32 build:
> code that #includes <cstdio> does this this:
> . D:/MINGW/include/c++/3.3/cstdio
> .. D:/MINGW/include/stdio.h  <<< defines __need__va_list
> ... D:/MINGW/include/c++/3.3/stdarg.h
> .... D:/MINGW/include/c++/3.3/cstdarg
> ..... D:/MINGW/include/stdarg.h <<< mingw runtime header that fowards
to...
> ...... D:/MINGW/lib/gcc-lib/mingw32/3.3/include/stdarg.h
>
> The c-compatibility c++/3.3/stdarg.h included from stdio.h injects
> va_list into global even though the user only includes a std C++
> header and the C stdio.h header was careful to use __need__va_list to
> only get __gnuc_va_list typedef.
>


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