Linux-Sparse Archive on
 help / color / Atom feed
* [PATCH] syntax errors in numbers are not fatal
@ 2020-07-14 21:43 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2020-07-14 21:43 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

When parsing expressions, if an invalid number is reached, a fatal
error is issued. But this is not the kind of error for which
continuing the processing doesn't make sense, since the token
was already categorized as a number during the tokenization.

So, change the fatal error into a normal one (and set the value to 0).

Signed-off-by: Luc Van Oostenryck <>
 expression.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/expression.c b/expression.c
index 1160cd9cc593..02bb5b159d9f 100644
--- a/expression.c
+++ b/expression.c
@@ -379,7 +379,10 @@ Float:
-	error_die(expr->pos, "constant %s is not a valid number", show_token(token));
+	sparse_error(expr->pos, "constant %s is not a valid number", show_token(token));
+	expr->type = EXPR_VALUE;
+	expr->value = 0;
+	expr->ctype = &int_ctype;
 static struct token *generic_selection(struct token *token, struct expression **tree)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 21:43 [PATCH] syntax errors in numbers are not fatal Luc Van Oostenryck

Linux-Sparse Archive on

Archives are clonable:
	git clone --mirror linux-sparse/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sparse linux-sparse/ \
	public-inbox-index linux-sparse

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone