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]

Re: need info on __need_ usage


Ulrich Drepper wrote:
> 
> Sorry for the delay, I was out of town.

No problem.

> Bruce Korb <bkorb@cruzio.com> writes:
> > [...] I believe that such unwrappable headers can be detected with
> > the regular expression, "^#if.*__need_".
> 
> Only if you don't handle headers in the bits subdir.  <math.h> and
> <complex.h> use multi-inclusion for other things.

How do I detect that?

The problem is that fixincludes has a method for altering
certain files termed, "wrap".  It will automatically put
the "#ifndef/#define/.../#endif" wrappers around the file.
If this is done on a file that needs to be sourced multiple
times, there is a problem.  I want to detect multi-inclusion
so that the wrap function will know when to leave out the
wrapping.  (That function will also put fixed strings at
the start and/or end of a file.
See gcc/fixinc/fixfixes.c(wrap_fix) if I am not being clear enough.)

So, it boils down to:  how does one hack at wrap_fix in such
a way that it will not wrap files that must not be wrapped?

> There used to be quite some systems where the headers
> were not appropriately protected and one had to include them in a
> certain order.

Yeah, it was the mid-80's last time I was banging my head on that.  :-(

Cheers,
	Bruce

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