[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    #line
From:       terra () gnome ! org (Morten Welinder)
Date:       2004-07-30 14:38:48
Message-ID: 20040730143848.DDA651422D58 () darter ! rentec ! com
[Download RAW message or body]


Stuff from bison contains #line directives.  This makes sparse ignore
such lines.  This helps but doesn't exactly make sparse happy over such
.c files.

(Ignoring isn't quite right because, arguably, later error messages should
refer to the file from which the c code was generated, not from the c code
itself.)


Morten




===== pre-process.c 1.91 vs edited =====
--- 1.91/pre-process.c	2004-07-26 13:21:57 -04:00
+++ edited/pre-process.c	2004-07-30 10:33:43 -04:00
@@ -1307,6 +1307,14 @@
 	return 1;
 }
 
+/*
+ * We ignore #line for now.
+ */
+static int handle_line(struct stream *stream, struct token **line, struct token \
*token) +{
+	return 1;
+}
+
 static int handle_preprocessor_command(struct stream *stream, struct token **line, \
struct ident *ident, struct token *token)  {
 	int i;
@@ -1326,6 +1334,7 @@
 		{ "error",	handle_error },
 		{ "include",	handle_include },
 		{ "pragma",	handle_pragma },
+		{ "line",	handle_line },
 
 		// our internal preprocessor tokens
 		{ "nostdinc",	handle_nostdinc },
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic