On 2020-05-29 6:03 p.m., Samuel Thibault wrote:
> Fixes
>
> ../../gdb/gnu-nat.c:2554:7: error: unused variable ‘res’
> [-Werror=unused-variable]
> 2554 | int res;
> ../../gdb/gnu-nat.c:2644:20: error: unused variable ‘old_address’
> [-Werror=unused-variable]
> 2644 | vm_address_t old_a
Fixes
../../gdb/gnu-nat.c:2554:7: error: unused variable ‘res’
[-Werror=unused-variable]
2554 | int res;
../../gdb/gnu-nat.c:2644:20: error: unused variable ‘old_address’
[-Werror=unused-variable]
2644 | vm_address_t old_address = region_address;
gdb/ChangeLog:
2020-05-29 Samuel Thi
gdb/ChangeLog:
2020-05-29 Samuel Thibault
* gnu-nat.c (gnu_xfer_auxv): Remove unused `res' variable.
(gnu_nat_target::find_memory_regions): Remove unused
`old_address' variable.
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 3b438a9a43..78e9ab7f71 100644
--- a/gdb/g
Justus Winter, le Wed 12 Mar 2014 15:55:48 +0100, a écrit :
> * mach-defpager/default_pager.c (pager_alloc): Declare variables only
> when needed.
> (dealloc_direct): Remove unused variables.
> (seqnos_memory_object_terminate): Remove unused variable, adjust
> ddprin
* mach-defpager/default_pager.c (pager_alloc): Declare variables only
when needed.
(dealloc_direct): Remove unused variables.
(seqnos_memory_object_terminate): Remove unused variable, adjust
ddprintfs accordingly.
(seqnos_memory_object_data_write): Remove unused variable.
---
mach-defpager
* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
[MACH_SLOCKS]: Remove #ifs.
* kern/task.c (task_lock, task_unlock): Remove address operator.
---
kern/lock.h | 6 --
kern/sched_prim.c | 18 +++
Marin Ramesa, le Sun 15 Dec 2013 22:00:12 +0100, a écrit :
> @@ -228,6 +228,8 @@ void assert_wait(
> thread_tthread;
> #if MACH_SLOCKS
> simple_lock_t lock;
> +#else /* MACH_SLOCKS */
> + decl_simple_lock_data( , *lock);
> #endif /* MACH_SLOCKS */
* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
* kern/task.c (task_lock, task_unlock) (task): Remove address operator.
---
kern/lock.h | 6 --
kern/sched_prim.c | 6 ++
kern/task.c | 4 ++--
On 15.12.2013 20:13:22, Samuel Thibault wrote:
> > index 8fe3672..67067cf 100644
> > --- a/kern/task.c
> > +++ b/kern/task.c
> > @@ -769,7 +769,7 @@ kern_return_t task_info(
> > event_info->cow_faults = task->cow_faults;
> > event_info->messages_sent = task->messages_sent;
Marin Ramesa, le Thu 12 Dec 2013 18:27:04 +0100, a écrit :
> --- a/kern/lock.h
> +++ b/kern/lock.h
> @@ -94,7 +94,10 @@ extern voidcheck_simple_locks(void);
> /*
> * Do not allocate storage for locks if not needed.
> */
> -#define decl_simple_lock_data(class,name)
> +struc
about set
but unused variables.
* kern/lock.h (l): Define.
(decl_simple_lock_data): Likewise.
(simple_unlock): Likewise.
* kern/sched_prim.c [!MACH_SLOCKS] (lock): Declare.
* kern/task.c (task_info) (task_unlock) (task): Remove address operator.
---
kern/lock.h | 9 ++---
kern
Then I have to define decl_simple_lock_data() which means we end up
> > with a lot of unused locks. And simple_lock_try() needs to always
> > suceed with the value TRUE which means locks can't be initialized
> > to zero.
> >
> > It seems the best solution i
k_try() needs to always
> suceed with the value TRUE which means locks can't be initialized to
> zero.
>
> It seems the best solution is to use #ifs for MACH_SLOCKS to declare
> and set these unused variables.
GCC allows empty structures as an extension.
--
Richard Braun
ems the best solution is to use #ifs for MACH_SLOCKS to declare
and set these unused variables.
On Wed, Dec 11, 2013 at 05:30:43PM +0100, Marin Ramesa wrote:
> - ipc_mqueue_t mqueue;
> + ipc_mqueue_t mqueue = mqueue; /* Quiet GCC warning. */
Don't do that. Instead, tweak simple_unlock and similar functions this
way :
#define simple_unlock(l) ((void)(l))
--
Richard Braun
This is the second way to quiet GCC warnings about set but unused
variables during simple locks. The first one is here:
http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg6.html
Third way would be to declare an set mqueue and obj only if MACH_SLOCKS.
* ipc/ipc_port.c (ipc_port_set_seqno
On 02.12.2013 09:14:36, Marin Ramesa wrote:
> * kern/lock.h (decl_simple_lock_data): Define macro.
> (simple_unlock): Define so that lock is assigned to itself and add a
> comment saying why this was done.
> (simple_lock_try): Define so that lock data is cast to a boolean with
> the value TRUE and
* vm/vm_page.h (first_phys_addr, last_phys_addr): Remove unused variables.
---
vm/vm_page.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/vm/vm_page.h b/vm/vm_page.h
index 4536d1c..f5681d7 100644
--- a/vm/vm_page.h
+++ b/vm/vm_page.h
@@ -156,11 +156,6 @@ extern
queue_head_t
* kern/pc_sample.c (pc_sampling_enabled, pc_sampling_lock): Remove unused
variables.
---
kern/pc_sample.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kern/pc_sample.c b/kern/pc_sample.c
index 05c08b8..cdf8e95 100644
--- a/kern/pc_sample.c
+++ b/kern/pc_sample.c
@@ -43,9 +43,6
* i386/i386/pit.c (pitctr1_port, pitctr2_port): Remove unused variables.
---
i386/i386/pit.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/i386/i386/pit.c b/i386/i386/pit.c
index 4f156d8..85929e9 100644
--- a/i386/i386/pit.c
+++ b/i386/i386/pit.c
@@ -57,8 +57,6 @@ WITH THE USE OR
* i386/i386/pic.c (nintr, npics): Remove unused variables.
---
i386/i386/pic.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/i386/i386/pic.c b/i386/i386/pic.c
index 50ca150..75cb835 100644
--- a/i386/i386/pic.c
+++ b/i386/i386/pic.c
@@ -62,9 +62,6 @@ int curr_pic_mask;
intiunit
* i386/i386/trap.c (v86_assist_on, v86_unsafe_ok, v86_do_sti_cli,
v86_do_sti_immediate, cli_count, sti_count): Remove unused variables.
---
i386/i386/trap.c | 11 ---
1 file changed, 11 deletions(-)
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index ffb23bb..239c853 100644
--- a
y(l) (TRUE) /* always succeeds */
+
+/* Quiet GCC warnings about
+ * set but unused variables during
+ * simple_unlock().
+ */
+#define simple_unlock(l) (*l = *l)
+
+/* Quiet GCC warnings about
+ * set but unused variables during
+ * simple_lock_try(). Always succeeds.
+ */
+#def
Justus Winter, le Fri 08 Nov 2013 21:24:22 +0100, a écrit :
> Found using the Clang Static Analyzer.
>
> * mach-defpager/default_pager.c (seqnos_memory_object_terminate):
> Remove unused variables request_refs and name_refs.
Ack
> ---
> mach-defpager/default_pager.c |
Found using the Clang Static Analyzer.
* mach-defpager/default_pager.c (seqnos_memory_object_terminate):
Remove unused variables request_refs and name_refs.
---
mach-defpager/default_pager.c |3 ---
1 file changed, 3 deletions(-)
diff --git a/mach-defpager/default_pager.c b/mach-defpager
Miguel Figueiredo, le Sat 25 May 2013 11:54:47 +0100, a écrit :
> 2013-05-14 Miguel Figueiredo
>
> * mach-defpager/kalloc.c (kalloc_init): remove unused variables
Applied, thanks.
> diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c
> index 8efb85f..2f42509 1006
Miguel Figueiredo, le Mon 27 May 2013 23:30:17 +0100, a écrit :
> in case you feel it is worth it:
I'm balanced. It is small enough not to have to really care about
performance, and stuffing #if makes the code less readable.
> diff --git a/kern/thread.c b/kern/thread.c
> index 79f526a..574f184 10
Em 26-05-2013 22:39, Samuel Thibault escreveu:
Miguel Figueiredo, le Sun 26 May 2013 18:28:55 +0100, a écrit :
2013-05-26 Miguel Figueiredo
* kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused
variables
I wouldn't do that: they can be read from the debugger.
Samuel
Miguel Figueiredo, le Sun 26 May 2013 18:28:55 +0100, a écrit :
> 2013-05-26 Miguel Figueiredo
>
> * kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused
> variables
I wouldn't do that: they can be read from the debugger.
Samuel
2013-05-26 Miguel Figueiredo
* kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused
variables
diff --git a/kern/thread.c b/kern/thread.c
index 79f526a..2181d49 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -163,10 +163,8 @@ boolean_t stack_alloc_try(
if (stack
2013-05-14 Miguel Figueiredo
* mach-defpager/kalloc.c (kalloc_init): remove unused variables
diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c
index 8efb85f..2f42509 100644
--- a/mach-defpager/kalloc.c
+++ b/mach-defpager/kalloc.c
@@ -92,8 +92,6 @@ boolean_t
Miguel Figueiredo, le Mon 13 May 2013 22:06:25 +0100, a écrit :
> noticed a warning on unused variables:
Indeed.
Please see the GNU Changelog format in the GNU coding style, and the
changelog entry I've written for the commit of your fix. Please provide
it along your future patches.
Samuel
Hi all,
noticed a warning on unused variables:
--- a/kern/slab.c
+++ b/kern/slab.c
@@ -1319,7 +1319,6 @@ void kalloc_init(void)
{
char name[KMEM_CACHE_NAME_SIZE];
size_t i, size;
-vm_offset_t min, max;
size = 1 << KALLOC_FIRST_SHIFT;
--
Melhores cumprimentos/Best r
Guillem Jover, le Thu 01 Sep 2011 17:17:22 +0200, a écrit :
> * linux/dev/drivers/block/floppy.c (setup_rw_floppy): Remove `dflags'.
> (floppy_eject): Remove `dummy'.
> * linux/src/drivers/net/8390.c (ethdev_init): Remove `ei_local'.
> * linux/src/drivers/scsi/ppa.c (ppa_detect): Remove `ppb'.
App
* linux/dev/drivers/block/floppy.c (setup_rw_floppy): Remove `dflags'.
(floppy_eject): Remove `dummy'.
* linux/src/drivers/net/8390.c (ethdev_init): Remove `ei_local'.
* linux/src/drivers/scsi/ppa.c (ppa_detect): Remove `ppb'.
---
linux/dev/drivers/block/floppy.c |6 ++
linux/src/drivers/n
Guillem Jover, le Thu 25 Aug 2011 15:22:35 +0200, a écrit :
> * i386/i386at/com.c (comstart): Disable `i' variable.
> * linux/src/drivers/net/at1700.c (net_close): Disable `lp' variable.
> * linux/dev/include/linux/blk.h (end_request): Disable `nsect' variable
> on MACH.
Applied, thanks.
Samuel
Guillem Jover, le Thu 25 Aug 2011 15:22:34 +0200, a écrit :
> * vm/memory_object_proxy.c (memory_object_create_proxy): Remove unused
> `kr' variable.
> * linux/dev/glue/block.c (free_buffer): Remove unused `i' variable.
> (register_blkdev): Remove unused `err' variable.
> (unregister_blkdev): Likew
* i386/i386at/com.c (comstart): Disable `i' variable.
* linux/src/drivers/net/at1700.c (net_close): Disable `lp' variable.
* linux/dev/include/linux/blk.h (end_request): Disable `nsect' variable
on MACH.
---
i386/i386at/com.c |2 ++
linux/dev/include/linux/blk.h |2 ++
linux/
* vm/memory_object_proxy.c (memory_object_create_proxy): Remove unused
`kr' variable.
* linux/dev/glue/block.c (free_buffer): Remove unused `i' variable.
(register_blkdev): Remove unused `err' variable.
(unregister_blkdev): Likewise.
(bread): Likewise.
(init_partition): Likewise.
* linux/dev/glue/n
39 matches
Mail list logo