bug or problem with gcc and include files
Robert Marcano
robert at marcanoonline.com
Thu Mar 25 15:48:58 UTC 2004
On Thu, 2004-03-25 at 11:38, Nils Philippsen wrote:
> On Thu, 2004-03-25 at 16:30, Robert Marcano wrote:
> > On Thu, 2004-03-25 at 11:14, Steve Wampler wrote:
> > > On Thu, 2004-03-25 at 06:59, jludwig wrote:
> > > > If include is a preprocessor directive how can it be in the body of a
> > > > function?
> > >
> > > Uh, how can it not be ok there? The preprocessor doesn't know
> > > anything about function bodies - it's just processing text, not
> > > C code.
> > >
> > > In fact, you can do some amazing things with the preprocessor,
> > > most of which shouldn't be done.
> >
> > A good example of this is located at
> > http://lxr.mozilla.org/security/source/security/nss/lib/softoken/pkcs11.c#110
> >
> > this #include allows this code to define a function pointers structure
> > with the same function definitions previously included
>
> Nevertheless, usually headers need to be "aware" of being included at
> random places. Most system headers aren't.
Most? I think that no respectable system headers will use those tricks.
They must be used for internal code, not APIs
>
> Nils
> --
> Nils Philippsen / Red Hat / nphilipp at redhat.com
> "They that can give up essential liberty to obtain a little temporary
> safety deserve neither liberty nor safety." -- B. Franklin, 1759
> PGP fingerprint: C4A8 9474 5C4C ADE3 2B8F 656D 47D8 9B65 6951 3011
--
Robert Marcano
More information about the users
mailing list