aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2019-03-08 10:15:12 -0500
committerSimon Marchi <simon.marchi@efficios.com>2019-03-09 08:09:39 -0500
commit568c0683da0a5d1cf5c62c9deb8abb8513875eee (patch)
tree33795c3e5f6224971cec35a371f42f7df9ac9747
parentf09ce22d6a2266c3bbe5061eb61e7fad65568652 (diff)
downloadgdb-568c0683da0a5d1cf5c62c9deb8abb8513875eee.zip
gdb-568c0683da0a5d1cf5c62c9deb8abb8513875eee.tar.gz
gdb-568c0683da0a5d1cf5c62c9deb8abb8513875eee.tar.bz2
Remove unnecessary cases from rank_one_type's switch
We return INCOMPATIBLE_TYPE_BADNESS for all these type codes, so we might as well just let them go to the default case. Incidentally, this patch also makes this false positive error go away when compiling with gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0, default compiler on Ubuntu 18.04. CXX gdbtypes.o /home/smarchi/src/binutils-gdb/gdb/gdbtypes.c: In function ‘rank rank_one_type(type*, type*, value*)’: /home/smarchi/src/binutils-gdb/gdb/gdbtypes.c:4259:1: error: control reaches end of non-void function [-Werror=return-type] } ^ gdb/ChangeLog: * gdbtypes.c (rank_one_type): Remove unnecessary cases from switch.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/gdbtypes.c33
2 files changed, 4 insertions, 33 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b96a40d..63b8095 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
+ * gdbtypes.c (rank_one_type): Remove unnecessary cases from switch.
+
+2019-03-08 Simon Marchi <simon.marchi@efficios.com>
+
* gdbtypes.c (rank_one_type_parm_set): New function extracted
from...
(rank_one_type): ... this.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 729d849..09284ef 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4284,41 +4284,8 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
return rank_one_type_parm_complex (parm, arg, value);
case TYPE_CODE_STRUCT:
return rank_one_type_parm_struct (parm, arg, value);
- case TYPE_CODE_UNION:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_UNION:
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_MEMBERPTR:
- switch (TYPE_CODE (arg))
- {
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_METHOD:
- switch (TYPE_CODE (arg))
- {
-
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_REF:
- switch (TYPE_CODE (arg))
- {
-
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
-
- break;
case TYPE_CODE_SET:
return rank_one_type_parm_set (parm, arg, value);
- case TYPE_CODE_VOID:
default:
return INCOMPATIBLE_TYPE_BADNESS;
} /* switch (TYPE_CODE (arg)) */