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: cpplib bug fix (macro expansion)


Zack Weinberg wrote:

> The comment problem should be easy to fix, but I'm not sure about the rest.
> is_hor_space won't work: consider
>
> #define F(a) a
>
> F
>   (foo)

You're right....my mistake.

> To avoid collapsing spaces, it would have to be possible to return to a
> marker after having popped an arbitrary number of macro buffers off the
> stack, or else I'd need a scratch area to save all the spaces in.  Either
> would be difficult.

You don't need to preserve the spaces in the macro buffers, just in the source
file buffer. That's why the mark is set after the macro buffers are all popped
off the stack. I think a combination of the existing mark/return scheme and
something to note spaces in the macro buffers is in order.

Dave



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