bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Line synchronisation output in comments


From: Eric Blake
Subject: Re: [PATCH] Line synchronisation output in comments
Date: Thu, 24 May 2007 06:13:47 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Sergey Poznyakoff on 5/24/2007 2:34 AM:
> Hello,

Hello Sergey,

> 
> When outputting comment blocks, m4 inserts line synchronisation
> directives into them and this makes compilers get out of sync when
> reporting diagnostics.  For example, given this input:
> 
> -- sample begin --
> changecom(/*,*/)
> /* line 1
>    line 2
> */
> TEXT
> -- sample end --
> 
> m4 -s produces the following:
> 
> -- output begin --
> #line 1 "sample.m4"
> 
> #line 4
> /* line 1
> #line 4
>    line 2
> #line 4
> */
> TEXT
> -- output end --        
> 
> which expands the comment by two lines and forces compiler to believe that
> the word `TEXT' appears at the line 9 (instead of the line 5).

Thanks for the report and analysis.  I agree that a comment is a single
token (even if it occupies multiple lines), and therefore, only a single
line directive should be issued at the start of the comment instead of
repeating the same directive for each line of the comment.  Would you mind
signing copyright papers, as this patch is not trivial?  Also, can you add
mention of this to NEWS and documentation (including a test case) to m4.texi?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVYF784KuGfSFAYARAmFnAJ4gJ5tee4z3IXVF2RvHkL8Lb5NyVgCg2SnT
steKm5WD2QlrOq9zQD5U1yU=
=tC3/
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]