diff mbox series

[2/6] show-parse: don't display null ident in show_typename()

Message ID 20181216172151.1361-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series small improvements of show_typename() | expand

Commit Message

Luc Van Oostenryck Dec. 16, 2018, 5:21 p.m. UTC
Often show_typename() is used to display a type and the associated
identifier is irrelevant but is displayed nevertheless.

However, when the identifier is itself not present, it is still
displayed as '<noident>', which is just noise can be confusing.

Fix this by displaying nothing for null identifiers in show_typename().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 show-parse.c                       |  3 ++-
 validation/builtin-overflow.c      | 12 ++++++------
 validation/c11-atomic.c            |  6 +++---
 validation/cast-bad-00.c           |  4 ++--
 validation/choose_expr.c           |  4 ++--
 validation/expand/builtin-expect.c |  4 ++--
 validation/nocast.c                |  2 +-
 validation/noderef.c               |  2 +-
 validation/ptr-inherit.c           | 10 +++++-----
 validation/restrict.c              |  6 +++---
 10 files changed, 27 insertions(+), 26 deletions(-)
diff mbox series

Patch

diff --git a/show-parse.c b/show-parse.c
index 5590dae9b..e8a0b4dcb 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -353,7 +353,8 @@  deeper:
 		break;
 
 	case SYM_NODE:
-		append(name, "%s", show_ident(sym->ident));
+		if (sym->ident)
+			append(name, "%s", show_ident(sym->ident));
 		mod |= sym->ctype.modifiers;
 		combine_address_space(sym->pos, &as, sym->ctype.as);
 		break;
diff --git a/validation/builtin-overflow.c b/validation/builtin-overflow.c
index a3dacc265..798868a31 100644
--- a/validation/builtin-overflow.c
+++ b/validation/builtin-overflow.c
@@ -143,13 +143,13 @@  builtin-overflow.c:62:38:         int enum e [signed] e
 builtin-overflow.c:63:41: error: invalid type for argument 2:
 builtin-overflow.c:63:41:         int enum e [signed] e
 builtin-overflow.c:64:45: error: invalid type for argument 3:
-builtin-overflow.c:64:45:         int enum e *<noident>
+builtin-overflow.c:64:45:         int enum e *
 builtin-overflow.c:65:38: error: invalid type for argument 1:
 builtin-overflow.c:65:38:         bool [unsigned] [usertype] b
 builtin-overflow.c:66:41: error: invalid type for argument 2:
 builtin-overflow.c:66:41:         bool [unsigned] [usertype] b
 builtin-overflow.c:67:45: error: invalid type for argument 3:
-builtin-overflow.c:67:45:         bool *<noident>
+builtin-overflow.c:67:45:         bool *
 builtin-overflow.c:68:44: error: invalid type for argument 3:
 builtin-overflow.c:68:44:         void *p
 builtin-overflow.c:70:39: error: not enough arguments for __builtin_add_overflow_p
@@ -179,13 +179,13 @@  builtin-overflow.c:86:38:         int enum e [signed] [addressable] e
 builtin-overflow.c:87:41: error: invalid type for argument 2:
 builtin-overflow.c:87:41:         int enum e [signed] [addressable] e
 builtin-overflow.c:88:45: error: invalid type for argument 3:
-builtin-overflow.c:88:45:         int enum e *<noident>
+builtin-overflow.c:88:45:         int enum e *
 builtin-overflow.c:89:38: error: invalid type for argument 1:
 builtin-overflow.c:89:38:         bool [unsigned] [addressable] [usertype] b
 builtin-overflow.c:90:41: error: invalid type for argument 2:
 builtin-overflow.c:90:41:         bool [unsigned] [addressable] [usertype] b
 builtin-overflow.c:91:45: error: invalid type for argument 3:
-builtin-overflow.c:91:45:         bool *<noident>
+builtin-overflow.c:91:45:         bool *
 builtin-overflow.c:92:44: error: invalid type for argument 3:
 builtin-overflow.c:92:44:         void *p
 builtin-overflow.c:94:39: error: not enough arguments for __builtin_sub_overflow_p
@@ -215,13 +215,13 @@  builtin-overflow.c:110:38:         int enum e [signed] [addressable] e
 builtin-overflow.c:111:41: error: invalid type for argument 2:
 builtin-overflow.c:111:41:         int enum e [signed] [addressable] e
 builtin-overflow.c:112:45: error: invalid type for argument 3:
-builtin-overflow.c:112:45:         int enum e *<noident>
+builtin-overflow.c:112:45:         int enum e *
 builtin-overflow.c:113:38: error: invalid type for argument 1:
 builtin-overflow.c:113:38:         bool [unsigned] [addressable] [usertype] b
 builtin-overflow.c:114:41: error: invalid type for argument 2:
 builtin-overflow.c:114:41:         bool [unsigned] [addressable] [usertype] b
 builtin-overflow.c:115:45: error: invalid type for argument 3:
-builtin-overflow.c:115:45:         bool *<noident>
+builtin-overflow.c:115:45:         bool *
 builtin-overflow.c:116:44: error: invalid type for argument 3:
 builtin-overflow.c:116:44:         void *p
 builtin-overflow.c:118:39: error: not enough arguments for __builtin_mul_overflow_p
diff --git a/validation/c11-atomic.c b/validation/c11-atomic.c
index bea3dab8f..e87d06cd1 100644
--- a/validation/c11-atomic.c
+++ b/validation/c11-atomic.c
@@ -73,19 +73,19 @@  c11-atomic.c:11:6: error: symbol 'f02' redeclared with different type (originall
 c11-atomic.c:12:6: error: symbol 'f03' redeclared with different type (originally declared at c11-atomic.c:4) - incompatible argument 1 (different modifiers)
 c11-atomic.c:33:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:33:13:    expected int *extern [assigned] puo
-c11-atomic.c:33:13:    got int const *<noident>
+c11-atomic.c:33:13:    got int const *
 c11-atomic.c:34:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:34:13:    expected int *extern [assigned] puo
 c11-atomic.c:34:13:    got int const *extern [assigned] pqo
 c11-atomic.c:48:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:48:13:    expected int *extern [assigned] puo
-c11-atomic.c:48:13:    got int [atomic] *<noident>
+c11-atomic.c:48:13:    got int [atomic] *
 c11-atomic.c:49:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:49:13:    expected int *extern [assigned] puo
 c11-atomic.c:49:13:    got int [atomic] *extern [assigned] pqo
 c11-atomic.c:63:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:63:13:    expected int *extern [assigned] puo
-c11-atomic.c:63:13:    got int [atomic] *<noident>
+c11-atomic.c:63:13:    got int [atomic] *
 c11-atomic.c:64:13: warning: incorrect type in assignment (different modifiers)
 c11-atomic.c:64:13:    expected int *extern [assigned] puo
 c11-atomic.c:64:13:    got int [atomic] *extern [assigned] pqo
diff --git a/validation/cast-bad-00.c b/validation/cast-bad-00.c
index 5f4a895f5..30aae2375 100644
--- a/validation/cast-bad-00.c
+++ b/validation/cast-bad-00.c
@@ -38,10 +38,10 @@  void struct_to_int(u16 val)
  *
  * check-error-start
 cast-bad-00.c:25:18: warning: incorrect type in argument 2 (different base types)
-cast-bad-00.c:25:18:    expected unsigned int [unsigned] [usertype] <noident>
+cast-bad-00.c:25:18:    expected unsigned int [unsigned] [usertype]
 cast-bad-00.c:25:18:    got union u [assigned] u
 cast-bad-00.c:33:18: warning: incorrect type in argument 2 (different base types)
-cast-bad-00.c:33:18:    expected unsigned int [unsigned] [usertype] <noident>
+cast-bad-00.c:33:18:    expected unsigned int [unsigned] [usertype]
 cast-bad-00.c:33:18:    got struct s [assigned] s
  * check-error-end
  */
diff --git a/validation/choose_expr.c b/validation/choose_expr.c
index f6fd84cf2..b075e6562 100644
--- a/validation/choose_expr.c
+++ b/validation/choose_expr.c
@@ -8,10 +8,10 @@  static int z = 1/(sizeof(__builtin_choose_expr(1,s,0)) - 42);
  * check-error-start
 choose_expr.c:1:51: warning: incorrect type in initializer (different base types)
 choose_expr.c:1:51:    expected int static [signed] [toplevel] x
-choose_expr.c:1:51:    got void <noident>
+choose_expr.c:1:51:    got void
 choose_expr.c:2:41: warning: incorrect type in initializer (different base types)
 choose_expr.c:2:41:    expected int static [signed] [toplevel] y
-choose_expr.c:2:41:    got char *<noident>
+choose_expr.c:2:41:    got char *
 choose_expr.c:4:17: warning: division by zero
  * check-error-end
  */
diff --git a/validation/expand/builtin-expect.c b/validation/expand/builtin-expect.c
index 77f714ef8..1207c1326 100644
--- a/validation/expand/builtin-expect.c
+++ b/validation/expand/builtin-expect.c
@@ -86,10 +86,10 @@  fptr:
  *
  * check-error-start
 expand/builtin-expect.c:33:33: warning: incorrect type in argument 1 (different base types)
-expand/builtin-expect.c:33:33:    expected long [signed] <noident>
+expand/builtin-expect.c:33:33:    expected long [signed]
 expand/builtin-expect.c:33:33:    got void *a
 expand/builtin-expect.c:33:36: warning: incorrect type in argument 2 (different base types)
-expand/builtin-expect.c:33:36:    expected long [signed] <noident>
+expand/builtin-expect.c:33:36:    expected long [signed]
 expand/builtin-expect.c:33:36:    got void *a
 expand/builtin-expect.c:33:32: warning: incorrect type in return expression (different base types)
 expand/builtin-expect.c:33:32:    expected void *
diff --git a/validation/nocast.c b/validation/nocast.c
index cc0ab6b7c..6c5da9687 100644
--- a/validation/nocast.c
+++ b/validation/nocast.c
@@ -160,7 +160,7 @@  nocast.c:34:33:    got unsigned long
 nocast.c:34:33: warning: implicit cast to nocast type
 nocast.c:35:39: warning: incorrect type in initializer (different modifiers)
 nocast.c:35:39:    expected unsigned long *static [toplevel] bad_ptr_from
-nocast.c:35:39:    got unsigned long [nocast] *<noident>
+nocast.c:35:39:    got unsigned long [nocast] *
 nocast.c:35:39: warning: implicit cast from nocast type
 nocast.c:50:16: warning: implicit cast from nocast type
 nocast.c:54:16: warning: implicit cast from nocast type
diff --git a/validation/noderef.c b/validation/noderef.c
index 8c89f6092..bcd6c08cb 100644
--- a/validation/noderef.c
+++ b/validation/noderef.c
@@ -46,6 +46,6 @@  static void h(void)
  * check-error-start
 noderef.c:24:12: warning: incorrect type in assignment (different modifiers)
 noderef.c:24:12:    expected char *[noderef] *q2
-noderef.c:24:12:    got char [noderef] **<noident>
+noderef.c:24:12:    got char [noderef] **
  * check-error-end
  */
diff --git a/validation/ptr-inherit.c b/validation/ptr-inherit.c
index 873305676..69e5a931b 100644
--- a/validation/ptr-inherit.c
+++ b/validation/ptr-inherit.c
@@ -63,18 +63,18 @@  static void test_tls(void)
  * check-error-start
 ptr-inherit.c:12:19: warning: incorrect type in initializer (different modifiers)
 ptr-inherit.c:12:19:    expected int *p
-ptr-inherit.c:12:19:    got int const *<noident>
+ptr-inherit.c:12:19:    got int const *
 ptr-inherit.c:18:19: warning: incorrect type in initializer (different modifiers)
 ptr-inherit.c:18:19:    expected int *p
-ptr-inherit.c:18:19:    got int volatile *<noident>
+ptr-inherit.c:18:19:    got int volatile *
 ptr-inherit.c:24:19: warning: incorrect type in initializer (different modifiers)
 ptr-inherit.c:24:19:    expected int *p
-ptr-inherit.c:24:19:    got int [noderef] *<noident>
+ptr-inherit.c:24:19:    got int [noderef] *
 ptr-inherit.c:30:19: warning: incorrect type in initializer (different base types)
 ptr-inherit.c:30:19:    expected int *p
-ptr-inherit.c:30:19:    got restricted int *<noident>
+ptr-inherit.c:30:19:    got restricted int *
 ptr-inherit.c:36:19: warning: incorrect type in initializer (different address spaces)
 ptr-inherit.c:36:19:    expected int *p
-ptr-inherit.c:36:19:    got int <asn:1> *<noident>
+ptr-inherit.c:36:19:    got int <asn:1> *
  * check-error-end
  */
diff --git a/validation/restrict.c b/validation/restrict.c
index f431f6d0f..92bfdae88 100644
--- a/validation/restrict.c
+++ b/validation/restrict.c
@@ -73,19 +73,19 @@  restrict.c:11:6: error: symbol 'f02' redeclared with different type (originally
 restrict.c:12:6: error: symbol 'f03' redeclared with different type (originally declared at restrict.c:4) - incompatible argument 1 (different modifiers)
 restrict.c:33:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:33:13:    expected void **extern [assigned] pup
-restrict.c:33:13:    got void *const *<noident>
+restrict.c:33:13:    got void *const *
 restrict.c:34:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:34:13:    expected void **extern [assigned] pup
 restrict.c:34:13:    got void *const *extern [assigned] pqp
 restrict.c:48:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:48:13:    expected void **extern [assigned] pup
-restrict.c:48:13:    got void *restrict *<noident>
+restrict.c:48:13:    got void *restrict *
 restrict.c:49:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:49:13:    expected void **extern [assigned] pup
 restrict.c:49:13:    got void *restrict *extern [assigned] prp
 restrict.c:63:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:63:13:    expected void **extern [assigned] pup
-restrict.c:63:13:    got void *restrict *<noident>
+restrict.c:63:13:    got void *restrict *
 restrict.c:64:13: warning: incorrect type in assignment (different modifiers)
 restrict.c:64:13:    expected void **extern [assigned] pup
 restrict.c:64:13:    got void *restrict *extern [assigned] prp