This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 00/13] Splut rank_one_type in smaller functions


The initial reason for this series is to investigate the following error
I get when building on Ubuntu 18.04, using the default compiler (gcc
(Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0).

  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]
 }
 ^

I wanted to see if this was a false positive specific to this gcc
version (I assume it is, since I haven't seen anybody report this error
before).  To do that, I started to manually verify each execution path
of that function and see if execution can really reach the end.
However, due to the size and complexity of the switch in that function,
it was not very practical.  So I started to split that switch in smaller
functions (one per type code of PARM).  At some point, the error
disappeared.  It turns out that it's the last patch that makes the error
disappear.

But still, I think this series is useful, since it gets rid of a false
positive error and makes the code a little bit more readable at the same
time.

Copyright assignment status: I am currently not covered by a copyright
assignment, so I will push this once it is sorted out.  This series
might now actually be significant w.r.t. copyright, since it is just
moving some code around, but in any case it is not really urgent to
merge it either.

I ran this series through the buildbot, it reported no new failure.

Simon Marchi (13):
  Split rank_one_type_parm_ptr from rank_one_type
  Split rank_one_type_parm_array from rank_one_type
  Split rank_one_type_parm_func from rank_one_type
  Split rank_one_type_parm_int from rank_one_type
  Split rank_one_type_parm_enum from rank_one_type
  Split rank_one_type_parm_char from rank_one_type
  Split rank_one_type_parm_range from rank_one_type
  Split rank_one_type_parm_bool from rank_one_type
  Split rank_one_type_parm_float from rank_one_type
  Split rank_one_type_parm_complex from rank_one_type
  Split rank_one_type_parm_struct from rank_one_type
  Split rank_one_type_parm_set from rank_one_type
  Remove unnecessary cases from rank_one_type's switch

 gdb/gdbtypes.c | 742 ++++++++++++++++++++++++++-----------------------
 1 file changed, 400 insertions(+), 342 deletions(-)

-- 
2.21.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]