[patch] mkcshadow improvements

Nathan Myers ncm@cantrip.org
Tue May 16 03:33:00 GMT 2000


> > Anthony's idea of pre-including headers that are sub-included
> > (in direct violation, by the way, of ISO C Standard requirements!)
> > is interesting.  The trick is to know which ones to put where,
> > because which ones you need will vary with target system and 
> > version, and we like to minimize such per-target variations.
> 
> In what way does it violate the C standard requirements? 

Anthony, I'm not criticizing your idea.  For Sun's (or Gcc's) C headers 
to sub-include <stdio.h> is very clearly in blatant violation of 
the C Standard.

If necessary, we can put something like

  #ifdef _BOGUS_C_SUBINCLUDES
  #  define _BOGUS_INCLUDES_FOR_CFLOAT
  #  include <target/bogus_includes.h>
  #endif

near the top of <cfloat> (and similarly for certain other headers, as 
discovered while porting), and then provide <target/bogus_includes.h> 
headers to include <stdio.h> or whatever's needed, just for targets 
where it's needed.  The idea is that our official headers are the
same for all platforms and targets, and broken things are off in
their own file somewhere out of the way.

> That was why I suggested the #undef __cplusplus - if we can fool the
> headers into thinking they're in C code without having any additional
> side effects than missing extern "C"{} sections, then we're laughing.
> However, it's the "additional side effects" bit that worries me.

Unfortunately, if we #undef __cplusplus (if that is even allowed?)
we open ourselves to declarations that not legal C++.  I don't 
think this alternative will be usable.

Nathan Myers
ncm at cantrip dot org



More information about the Libstdc++ mailing list