linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] DTC: Quiet a bogus "May be used uninitialized" warning.
@ 2007-10-19 17:42 Jon Loeliger
  2007-10-20  7:16 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Loeliger @ 2007-10-19 17:42 UTC (permalink / raw)
  To: linuxppc-dev


Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
 flattree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/flattree.c b/flattree.c
index a26e71b..5889900 100644
--- a/flattree.c
+++ b/flattree.c
@@ -136,7 +136,7 @@ static void asm_emit_cell(void *e, cell_t val)
 static void asm_emit_string(void *e, char *str, int len)
 {
 	FILE *f = e;
-	char c;
+	char c = 0;
 
 	if (len != 0) {
 		/* XXX: ewww */
-- 
1.5.3.1.139.g9346b

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

* Re: [PATCH 2/4] DTC: Quiet a bogus "May be used uninitialized" warning.
  2007-10-19 17:42 [PATCH 2/4] DTC: Quiet a bogus "May be used uninitialized" warning Jon Loeliger
@ 2007-10-20  7:16 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2007-10-20  7:16 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

On Fri, Oct 19, 2007 at 12:42:58PM -0500, Jon Loeliger wrote:
> 
> Signed-off-by: Jon Loeliger <jdl@freescale.com>

I don't like this one much.  The warning is indeed bogus, and my
compiler version, at least, doesn't generate it
	mulberryst:~/dtc$ gcc --version
	gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

Putting in the initializer would mean that even on non-broken
compilers, we wouldn't get the warning if we ever changed the
contained code so that it really should generate an unitialized
variable warning.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

end of thread, other threads:[~2007-10-20  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 17:42 [PATCH 2/4] DTC: Quiet a bogus "May be used uninitialized" warning Jon Loeliger
2007-10-20  7:16 ` David Gibson

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).