DTC: Quiet a bogus "May be used uninitialized" warning.
PATCH 2/4 DTC: Quiet a bogus "May be used uninitialized" warning.
Signed-off-by Jon Loeliger <[email protected]>
--- flattree.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
flattree.c +1 -1
@@ -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 */
Signature · 1 line
1.5.3.1.139.g9346b
Quoted 2 lines · Jon Loeliger
Signed-off-by Jon Loeliger <[email protected]>
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.
Signature · 4 lines
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