[PATCH] Fix PR preprocessor/6489 (take 2)

Jakub Jelinek jakub@redhat.com
Thu May 2 06:41:00 GMT 2002


On Wed, May 01, 2002 at 08:51:07AM -0700, Zack Weinberg wrote:
> > The following copes with \r, \n, \r\n and \n\r for directives, is that
> > enough?
> 
> The important case to handle is 
> 
> #define macro() do { \^M
>    code here         \^M
>  } while (0)
> 
> this is the only time people are likely to notice.  If this patch has
> that covered, go ahead and check it in.

It handles stuff like #include <foo.h>^M but not \^M. \^M is handled in
> 50 cases in that spaghetti code, I've started working on a patch but
it would be huge (what I wrote was about 14K patch and was far from
finishing it).
Is cpp -traditional actually performance critical?
Wonder if a simple pass over a newly read buffer which would
canonicalize line endings wouldn't be much cleaner and shorter
(and obviously correct)...

	Jakub



More information about the Gcc-patches mailing list