summaryrefslogtreecommitdiff
path: root/devel/cqual/patches/patch-ab
blob: 03335da133a1404ad79fca1f865e8d0cb6b279c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$NetBSD: patch-ab,v 1.2 2008/07/27 20:10:42 dholland Exp $

This patch avoid tons of #line warnings when parsing the output of newer
gcc.

--- src/c-lex.c.orig	2003-09-10 20:52:02.000000000 +0200
+++ src/c-lex.c	2008-07-27 15:29:09.000000000 -0400
@@ -96,8 +96,8 @@ static location make_location(struct Loc
     return last_allocated_location;
 
   last_allocated_location = ralloc(parse_region, struct Location);
+  l.location_index = next_location_index++;
   *last_allocated_location = l;
-  last_allocated_location->location_index = next_location_index++;
 
   return last_allocated_location;
 }
@@ -843,6 +843,9 @@ linenum:
 	  c = GETC();
 	  while (c == ' ' || c == '\t')
 	    c = GETC();
+	  /* Skip the file type (3 = system header, ...) of gcc */
+	  if (isdigit(c))
+	    c = GETC();
 	  if (c == '\n')
 	    return c;
 	  UNGETC (c);