Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] Remove old lint code
Date: Sun, 29 Jul 2018 21:29:00 -0000	[thread overview]
Message-ID: <20180729212952.28056-1-tom@tromey.com> (raw)

This removes dead code that, according to the comments, existed to
placate lint.  I don't think this has been relevant in a long time,
and certainly not since gdb switched to C++.

Tested by rebuilding.

ChangeLog
2018-07-29  Tom Tromey  <tom@tromey.com>

	* cli/cli-decode.c (lookup_cmd): Remove lint code.
	* value.c (unpack_long): Remove lint code.
	* valops.c (value_ind): Remove lint code.
	* valarith.c (value_x_binop, value_x_unop, value_equal)
	(value_pos): Remove lint code.
---
 gdb/ChangeLog        |  8 ++++++++
 gdb/cli/cli-decode.c |  1 -
 gdb/valarith.c       | 20 +++-----------------
 gdb/valops.c         |  1 -
 gdb/value.c          |  1 -
 5 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index c8dda700ca8..83dd67efe3f 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1561,7 +1561,6 @@ lookup_cmd (const char **line, struct cmd_list_element *list,
 	      }
 	  error (_("Ambiguous %scommand \"%s\": %s."), local_cmdtype,
 		 *line, ambbuf);
-	  return 0;		/* lint */
 	}
     }
   else
diff --git a/gdb/valarith.c b/gdb/valarith.c
index d2dd5900647..01ca50d3d21 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -504,9 +504,6 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
     }
   throw_error (NOT_FOUND_ERROR,
                _("member function %s not found"), tstr);
-#ifdef lint
-  return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1);
-#endif
 }
 
 /* We know that arg1 is a structure, so try to find a unary user
@@ -622,8 +619,6 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
     }
   throw_error (NOT_FOUND_ERROR,
                _("member function %s not found"), tstr);
-
-  return 0;			/* For lint -- never reached */
 }
 \f
 
@@ -1533,10 +1528,7 @@ value_equal (struct value *arg1, struct value *arg2)
       return value_strcmp (arg1, arg2) == 0;
     }
   else
-    {
-      error (_("Invalid type combination in equality test."));
-      return 0;			/* For lint -- never reached.  */
-    }
+    error (_("Invalid type combination in equality test."));
 }
 
 /* Compare values based on their raw contents.  Useful for arrays since
@@ -1628,10 +1620,7 @@ value_pos (struct value *arg1)
       || (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)))
     return value_from_contents (type, value_contents (arg1));
   else
-    {
-      error (_("Argument to positive operation not a number."));
-      return 0;			/* For lint -- never reached.  */
-    }
+    error (_("Argument to positive operation not a number."));
 }
 
 struct value *
@@ -1663,10 +1652,7 @@ value_neg (struct value *arg1)
       return val;
     }
   else
-    {
-      error (_("Argument to negate operation not a number."));
-      return 0;			/* For lint -- never reached.  */
-    }
+    error (_("Argument to negate operation not a number."));
 }
 
 struct value *
diff --git a/gdb/valops.c b/gdb/valops.c
index 9bdbf22b03c..de6f839c33c 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1588,7 +1588,6 @@ value_ind (struct value *arg1)
     }
 
   error (_("Attempt to take contents of a non-pointer value."));
-  return 0;			/* For lint -- never reached.  */
 }
 \f
 /* Create a value for an array by allocating space in GDB, copying the
diff --git a/gdb/value.c b/gdb/value.c
index af635ba5bc3..b0f22f1117e 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2777,7 +2777,6 @@ unpack_long (struct type *type, const gdb_byte *valaddr)
     default:
       error (_("Value can't be converted to integer."));
     }
-  return 0;			/* Placate lint.  */
 }
 
 /* Unpack raw data (copied from debugee, target byte order) at VALADDR
-- 
2.13.6


             reply	other threads:[~2018-07-29 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-29 21:29 Tom Tromey [this message]
2018-07-30 13:56 ` Simon Marchi
2018-07-30 14:29   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180729212952.28056-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox