aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--pre-process.c6
-rw-r--r--validation/preprocessor/ident-pragma.c12
-rw-r--r--validation/preprocessor/ident.c12
3 files changed, 30 insertions, 0 deletions
diff --git a/pre-process.c b/pre-process.c
index bf4b8e76..1ed7a47c 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -1977,6 +1977,11 @@ static int handle_line(struct stream *stream, struct token **line, struct token
return 1;
}
+static int handle_ident(struct stream *stream, struct token **line, struct token *token)
+{
+ return 1;
+}
+
static int handle_nondirective(struct stream *stream, struct token **line, struct token *token)
{
sparse_error(token->pos, "unrecognized preprocessor line '%s'", show_token_sequence(token, 0));
@@ -2003,6 +2008,7 @@ static void init_preprocessor(void)
{ "include_next", handle_include_next },
{ "pragma", handle_pragma },
{ "line", handle_line },
+ { "ident", handle_ident },
// our internal preprocessor tokens
{ "nostdinc", handle_nostdinc },
diff --git a/validation/preprocessor/ident-pragma.c b/validation/preprocessor/ident-pragma.c
new file mode 100644
index 00000000..81abdd7b
--- /dev/null
+++ b/validation/preprocessor/ident-pragma.c
@@ -0,0 +1,12 @@
+#pragma ident "foo"
+
+/*
+ * check-description: check that '#pragma ident ... " is ignored.
+ * check-name: ident-pragma
+ * check-command: sparse -E $file
+ *
+ * check-output-start
+
+
+ * check-output-end
+ */
diff --git a/validation/preprocessor/ident.c b/validation/preprocessor/ident.c
new file mode 100644
index 00000000..3e7f3ad0
--- /dev/null
+++ b/validation/preprocessor/ident.c
@@ -0,0 +1,12 @@
+#ident "foo"
+
+/*
+ * check-description: check that the non-standard "#ident ..." is ignored.
+ * check-name: ident
+ * check-command: sparse -E $file
+ *
+ * check-output-start
+
+
+ * check-output-end
+ */