fix show_typename()
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
@@ -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
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 theshow_typename()result.Signed-off-by Al Viro <[email protected]>
Applied, along with corresponding changes to the test suite, and pushed.
- Josh Triplett