Skip to contentSkip to conversation

fix show_typename()

PATCH In review Al Viro 2 participants 2 messages Feb 22, 2008 – Apr 3, 2008 Sparse checker

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 2/3 fix show_typename()

* postfix stuff had been applied in wrong order (e.g. int a[2][3] generated int [addressable][toplevel] a[3][2])
* after fixing that, we've no need for recursion anymore, a bunch of arguments go away and turn into local variables and we get an easy way to get rid of bogus space in the show_typename() result.

---
 evaluate.c   |    4 +-
 show-parse.c |  100 +++++++++++++++++++++++++++++----------------------------
 2 files changed, 53 insertions(+), 51 deletions(-)
evaluate.c +2 -2
index 777f603..2901c1b 100644
@@ -502,7 +502,7 @@ static inline void unrestrict(struct expression *expr,
 	if (class & TYPE_RESTRICT) {
 		if (class & TYPE_FOULED)
 			*ctype = unfoul(*ctype);
-		warning(expr->pos, "%sdegrades to integer",
+		warning(expr->pos, "%s degrades to integer",
 			show_typename(*ctype));
 		*ctype = (*ctype)->ctype.base_type; /* get to arithmetic type */
 	}
@@ -1802,7 +1802,7 @@ static struct symbol *evaluate_preop(struct expression *expr)
 			expr->right->ctype = ctype;
 			expr->right->fvalue = 0;
 		} else if (is_fouled_type(ctype)) {
-			warning(expr->pos, "%sdegrades to integer",
+			warning(expr->pos, "%s degrades to integer",
 				show_typename(ctype->ctype.base_type));
 		}
 		ctype = &bool_ctype;
show-parse.c +51 -49

171 lines not on this page · raw message

Signature · 1 line
1.5.3.GIT
#1 lore raw
Quoted 7 lines · Al Viro

* postfix stuff had been applied in wrong order (e.g. int a[2][3] generated int [addressable][toplevel] a[3][2])
* after fixing that, we've no need for recursion anymore, a bunch of arguments go away and turn into local variables and we get an easy way to get rid of bogus space in the show_typename() result.

Applied, along with corresponding changes to the test suite, and pushed.

- Josh Triplett