[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Included Interfaces without documentation update



Andreas Jaeger wrote:
> > > > > > Andreas Jaeger wrote:
> > > > > > > > _IO_putc
> > > > > > > Mangle for putc
> > > > > > > > _IO_puts
> > > > > > > Mangle for puts
> > > > > >
> > > > > > That's interesting.  I had no idea there were versions of feof etc.
> > > > > > with C++ linkage in the standard libraries.  What standard specifies that?
> > > > >
> > > > > No standard - that's the way glibc implements them.  Since LSB is not
> > > > > going to change glibc, we have to document these.
> > > >
> > > > Does it also export them with C linkage, then?
> > >
> > > Definitly - we describe a C ABI here.
> >
> > That's what I thought.  Then why are we also describing the mangled
> > names?  Seems like a bug to specify C++ mangled names for C library
> > functions.
> 
> Stuart has run with appcheck some tests and noticed that some
> programs, most probably C++ applications or libs, needed these, for
> example:
> 
> $ nm /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so |grep putc
>          U _IO_putc@@GLIBC_2.0
> 
> Since LSB supports C++, we have to add those symbols,

There's nothing technically saying you can't use C linkage in a C++
program; in fact, stdio.h is surrounded by extern "C" { ... }
to force this.

I notice the new C++ standard specifies include files named
<cstdio>; do these use C++ linkage for things like putc?
Let's see: here are three implementations:
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/gnusrc/gnu/dist/toolchain/libstdc++/cstdio?rev=1.1.1.1
http://msdn.microsoft.com/library/devprods/vs6/visualc/vclang/CSTDIO.HTM
http://symbolicnet.mcs.kent.edu/~pwang/stdc++lib.doc/cstdio.html
None of these would require that C++ mangled versions of stdio
be provided in any .a or .so file, I believe.

So, which standards document specifies that standard C library 
functions are available not just with C linkage but also with C++ linkage,
and that this must be provided in a library rather than 
a forwarding include file?

- Dan



Reply to: