Proposed header changes (for the trunk)

Stephen M. Webb stephen@bregmasoft.com
Fri May 18 20:48:00 GMT 2001


On Fri, 18 May 2001, Benjamin Kosnik wrote:
> 
> > (2) Introduce a simplified version of the c_shadow headers, call them the
> > c_legacy headers.  These headers would hoist the existing headers
> > into the _C_legacy namespace (as the c_shadow headers do) and inject
> > the relevant bits into the std namespace (as the c_shadow headers do),
> > but the wrappers would be much simpler.  Simple works.  The c_shadow
> > headers would still be available for someone to adopt as a project,
> > and the c_std headers would still be available where needed.
> 
> Sounds encouraging. I think simplified is good, too.
> 
> I'd suggest taking the existing c_std headers and squestering inside of 
> _C_legacy or whatever instead of starting with the existing c_shadow files.
> Some of the c_shadow bits are too complex and prone to failure: we don't 
> really need to wrap in extern "C", for example (just the namespace will work)

That's what I though when I started (okay, you suggested it).  I wish it was
that easy, but good old Koenig lookup begins to read its ugly head
(no, really, it's a Good Thing unless you're trying to wrap headers
with global names into another namespace).  A lot of changes have gone 
into the c_std headers since the c_shadow headers were written, so
that's where I started but the more I do what needs to be done, the
more they look like the c_shadow headers.

Event if the c_shadow headers were to be finished, a lot of work would need to
go into them to bring them up to speed with the c_std headers (C99 changes,
the cmath stuff, and so forth).

A lot of the c_shadow stuff can be reused:  we still need to wrap the
transitive closure of all headers files included, still need to take special
cases (like struct tm declared in wchar.h included by stdio.h) into account.

I just don't think all that ducking in and out of namespaces, weird partial
headers, and stuff like that is necessary.  The configury stuff alone is hairy
and could probably be done away with for the most part (I didn't really
touch it in the include/Makefile patch I just submitted).

> There will be no point in the c_shadow headers if this works, right? If 
> we could cut down on complexity it would be a good idea.

If it works.  One of my problems with the c_shadow headers is it's so 
convoluted in some parts I'm not sure what's really going on, and I don't think
it was done that way just to impress chicks.  I suspect nobody has spent time
making them work because they're so scary.  I wouldn't get rid of them right
away.

-- 

Stephen M. Webb
stephen at bregmasoft dot com



More information about the Libstdc++ mailing list