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: Bug in cpplib (was: Re: typos in f77 docs)


On Sat, Mar 27, 1999 at 01:07:30PM -0500, Zack Weinberg wrote:
> It /should/ always be escaped, but I can imagine conditions where it
> wouldn't.  Read through macarg() and that should tell you.
> 
> Your code to unescape @ is incorrect in general.  You want to translate '@@'

And when I looked at it after a good night's sleep I realized just how
incorrect.  Ignore that patch; if you haven't gotten to looking at this
by next week sometime, I'll try to write a less braindead solution.

> to '@', '@ ' and '@-' to nothing, and leave all other @'s alone.  (Deleting
> '@ ' may cause other problems, such as mysterious, inappropriate token
> concatenation.  However, it shouldn't.)

Why are macro arguments even getting this sort of escaping?  Do they
get run through code which expects them to be escaped after they get
substituted in?  In which case, wouldn't it be better to move some of
the escaping code to a separate routine and not ask cpp_get_token to do
it, allowing them never to become escaped if they don't need to be?

Just random thoughts.  Don't feel a need to answer any of that; I'm
going to sit down with the code in a few days when my life slows down,
and try to figure out the flow.

> The macro expansion code really needs to be gutted and rewritten.  It
> suffers from excessive cleverness.  Also I think it's the next performance
> bottleneck.

Excessive cleverness?  Yes, I suppose.  I have a few ideas about how to
approach it which might improve speed, but as I said, I need to sit
down and see if some of my hunches are correct first.

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/


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