[3/3] record-full: Remove unused function netorder16

Message ID 1498412703-24303-4-git-send-email-simon.marchi@ericsson.com
State New, archived
Headers

Commit Message

Simon Marchi June 25, 2017, 5:45 p.m. UTC
  clang shows this warning:

  /home/emaisin/src/binutils-gdb/gdb/record-full.c:2344:1: error: unused function 'netorder16' [-Werror,-Wunused-function]
  netorder16 (uint16_t input)
  ^

Remove this function, which, AFAIK, has never been used.  Note that GCC
doesn't warn about this, because the function is marked as inline.
According to gcc's man page, it should ideed not warn:

  -Wunused-function
    Warn whenever a static function is declared but not defined or a non-inline static function is unused.  This warning is enabled by -Wall.

So it's probably not a GCC bug that it doesn't find this unused function, but a
different definition of "unused".

gdb/ChangeLog:

	* record-full.c (netorder16): Remove.
---
 gdb/record-full.c | 10 ----------
 1 file changed, 10 deletions(-)
  

Comments

Yao Qi June 26, 2017, 10:43 a.m. UTC | #1
On Sun, Jun 25, 2017 at 6:45 PM, Simon Marchi <simon.marchi@ericsson.com> wrote:
> gdb/ChangeLog:
>
>         * record-full.c (netorder16): Remove.

Patch is good to me.
  
Simon Marchi June 26, 2017, 2:54 p.m. UTC | #2
On 2017-06-26 12:43, Yao Qi wrote:
> On Sun, Jun 25, 2017 at 6:45 PM, Simon Marchi 
> <simon.marchi@ericsson.com> wrote:
>> gdb/ChangeLog:
>> 
>>         * record-full.c (netorder16): Remove.
> 
> Patch is good to me.

Thanks, all patches are pushed in.
  

Patch

diff --git a/gdb/record-full.c b/gdb/record-full.c
index 8e774a2..7f6ecc7 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -2340,16 +2340,6 @@  netorder32 (uint32_t input)
   return ret;
 }
 
-static inline uint16_t
-netorder16 (uint16_t input)
-{
-  uint16_t ret;
-
-  store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), 
-			  BFD_ENDIAN_BIG, input);
-  return ret;
-}
-
 /* Restore the execution log from a core_bfd file.  */
 static void
 record_full_restore (void)