This is the mail archive of the gcc@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: Cpplib document: Macro Expansion algorithm


Gao, Jiafu wrote:-

> I am working on a project which needs similar functionality like
> the C/C++ macro expansion. I found the GNU GCC project has a
> pretty good CPP library. Unfortunately, the document for macro
> expansion algorithm part is empty. 
> 
>     http://gcc.gnu.org/onlinedocs/cppinternals_6.html#SEC6
> 
> I am wondering if this is left out unintentionally or intentionally? Is
> it possible to get some help (either in formal/informal document, or
> answering some questions) from the author? 

Well, the only reason it's left out is that I haven't written it yet
;-)

I haven't written it yet for many reasons.  Like I've found other
things to do that seemed more fun at the time, and that describing the
algorithm is kind of difficult; it's easy to make your description
more complicated than the algorithm itself is if you're not careful.
Pictures would make it a lot easier.

In my not entirely unbiased opinion, the code is quite clean and not
too hard to understand.  There are plenty of subtleties, though, and
before trying to figure it out by looking, I would take some time to
make sure you completely understand the way the C standard intends
that macros expand.

Feel free to ask the odd question or two.  But please heed my advice
above first.

Neil.


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