[4.0.1 patch] fix for 20907: long comments throw off line numbers

Geoffrey Keating geoffk@geoffk.org
Sat Apr 23 00:04:00 GMT 2005


Per Bothner <per@bothner.com> writes:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20907
> I've checked the attached patch into mainline.
> Now that 4.0 is released, should I check it into
> the 4.0 branch?  It seems quite safe.

It's missing a testcase, though.  Fortunately, I happen to have one
right here that just needs to be put in the right directory (written
by Devang):

Index: gcc/testsuite/gcc.apple/very-long-comment.c
===================================================================
RCS file: gcc/testsuite/gcc.apple/very-long-comment.c
diff -N gcc/testsuite/gcc.apple/very-long-comment.c
*** /dev/null   1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.apple/very-long-comment.c 21 Apr 2005 18:25:30 -0000
***************
*** 0 ****
--- 1,14 ----
+ /*
+ This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment.
+  */
+ #warning test warning /* { dg-warning "test warning" } */
+ #include <stdio.h>
+
+ int main()
+ {
+   printf("This is line %d\n", __LINE__);
+   return 0;
+ }
+
+ /* { dg-options "-Wall" } */
+ /* { dg-do compile } */



More information about the Gcc-patches mailing list