qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] darwin-user: Remove two unused variables
@ 2011-07-20 19:40 Stefan Weil
  2011-07-22 20:48 ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2011-07-20 19:40 UTC (permalink / raw)
  To: QEMU Developers; +Cc: qemu-trivial

cppcheck report:

darwin-user/signal.c:322: style: Unused variable: i
darwin-user/signal.c:322: style:
Variable 'err' is assigned a value that is never used

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 darwin-user/signal.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/darwin-user/signal.c b/darwin-user/signal.c
index e2adca3..c530227 100644
--- a/darwin-user/signal.c
+++ b/darwin-user/signal.c
@@ -319,7 +319,6 @@ static void setup_frame(int sig, struct emulated_sigaction *ka,
 			void *set, CPUState *env)
 {
 	void *frame;
-	int i, err = 0;
 
     fprintf(stderr, "setup_frame %d\n", sig);
 	frame = get_sigframe(ka, env, sizeof(*frame));
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] darwin-user: Remove two unused variables
  2011-07-20 19:40 [Qemu-devel] [PATCH] darwin-user: Remove two unused variables Stefan Weil
@ 2011-07-22 20:48 ` Andreas Färber
  2011-07-22 21:43   ` Stefan Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2011-07-22 20:48 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, QEMU Developers

Hi Stefan W.,

Am 20.07.2011 um 21:40 schrieb Stefan Weil:

> cppcheck report:
>
> darwin-user/signal.c:322: style: Unused variable: i
> darwin-user/signal.c:322: style:
> Variable 'err' is assigned a value that is never used

Does this really bug you? I'm a bit skeptical towards trying to fix  
warnings in code that doesn't compile either way... (or does it by now?)

Andreas

>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
> darwin-user/signal.c |    1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/darwin-user/signal.c b/darwin-user/signal.c
> index e2adca3..c530227 100644
> --- a/darwin-user/signal.c
> +++ b/darwin-user/signal.c
> @@ -319,7 +319,6 @@ static void setup_frame(int sig, struct  
> emulated_sigaction *ka,
> 			void *set, CPUState *env)
> {
> 	void *frame;
> -	int i, err = 0;
>
>     fprintf(stderr, "setup_frame %d\n", sig);
> 	frame = get_sigframe(ka, env, sizeof(*frame));
> -- 
> 1.7.2.5
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] darwin-user: Remove two unused variables
  2011-07-22 20:48 ` Andreas Färber
@ 2011-07-22 21:43   ` Stefan Weil
  2011-08-07  9:39     ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2011-07-22 21:43 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-trivial, QEMU Developers

Am 22.07.2011 22:48, schrieb Andreas Färber:
> Hi Stefan W.,
>
> Am 20.07.2011 um 21:40 schrieb Stefan Weil:
>
>> cppcheck report:
>>
>> darwin-user/signal.c:322: style: Unused variable: i
>> darwin-user/signal.c:322: style:
>> Variable 'err' is assigned a value that is never used
>
> Does this really bug you? I'm a bit skeptical towards trying to fix 
> warnings in code that doesn't compile either way... (or does it by now?)
>
> Andreas

Hi Andreas,

the warnings were the result of a static code inspection with
a program called cppcheck. I don't compile darwin code,
so I did not notice that the code does not compile.

Is there a good reason to keep those two unused variables?
Fixing the issue helps with static code analysis because
unnecessary manual code checks can be avoided.

Cheers,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] darwin-user: Remove two unused variables
  2011-07-22 21:43   ` Stefan Weil
@ 2011-08-07  9:39     ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-08-07  9:39 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, Andreas Färber, QEMU Developers

Thanks, applied.

On Fri, Jul 22, 2011 at 9:43 PM, Stefan Weil <weil@mail.berlios.de> wrote:
> Am 22.07.2011 22:48, schrieb Andreas Färber:
>>
>> Hi Stefan W.,
>>
>> Am 20.07.2011 um 21:40 schrieb Stefan Weil:
>>
>>> cppcheck report:
>>>
>>> darwin-user/signal.c:322: style: Unused variable: i
>>> darwin-user/signal.c:322: style:
>>> Variable 'err' is assigned a value that is never used
>>
>> Does this really bug you? I'm a bit skeptical towards trying to fix
>> warnings in code that doesn't compile either way... (or does it by now?)
>>
>> Andreas
>
> Hi Andreas,
>
> the warnings were the result of a static code inspection with
> a program called cppcheck. I don't compile darwin code,
> so I did not notice that the code does not compile.
>
> Is there a good reason to keep those two unused variables?
> Fixing the issue helps with static code analysis because
> unnecessary manual code checks can be avoided.
>
> Cheers,
> Stefan
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-07  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20 19:40 [Qemu-devel] [PATCH] darwin-user: Remove two unused variables Stefan Weil
2011-07-22 20:48 ` Andreas Färber
2011-07-22 21:43   ` Stefan Weil
2011-08-07  9:39     ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).