Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* warning/error about possibly uninitialized 'exact' in  find_line_symtab
@ 2009-02-23  2:32 Jay
  2009-02-23  4:07 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Jay @ 2009-02-23  2:32 UTC (permalink / raw)
  To: gdb-patches


I didn't want to deal with the stdint.h issue
I hit in 6.8 so I'm building 6.7.1.
I see now the mail threads where it was fixed pretty simply.
So maybe I'll go back to that.
 
 
In the meantime, with 6.7.1, I hit a simple problem (so far, still compiling)
warning variable 'exact' may be used uninitialized + -Werror.
 
 
Here is my patch:
 
 
-bash-3.2$ gdiff -u symtab.c.orig symtab.c
--- symtab.c.orig 2009-02-22 20:25:52.000000000 -0800
+++ symtab.c 2009-02-22 19:38:25.000000000 -0800
@@ -2249,7 +2249,7 @@
struct symtab *
find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match
)
{
- int exact;
+ int exact = { 0 };
/* BEST_INDEX and BEST_LINETABLE identify the smallest linenumber> LINE
so far seen. */
 
 
Sure, now it may be unoptimally unnecessarily initialized but
I don't think that is worth worrying about.
 
 
I use { 0 } instead of 0 because it is a more generic form that
can zero initialize "anything", except some unions on some compilers,
it might not always zero the entire thing.
 
 
Current source looks about the same.
 
 
My system is:
 
 
-bash-3.2$ gcc32 -v
Using built-in specs.
Target: hppa2.0w-hp-hpux11.11
Configured with: /src/gcc-4.3.3/configure -disable-nls -disable-bootstrap -prefi
x=/usr/local/32 -with-as=/usr/local/32/bin/gas -verbose
Thread model: posix
gcc version 4.3.3 (GCC)
 
 
-bash-3.2$ uname -a
HP-UX unknown B.11.11 U 9000/800 1595760578 unlimited-user license
 
 
gdb configured with:

 
$ /src/gdb-6.7.1/configure -disable-nls -prefix=/usr/local/32

 
and I rm -rf /src/gdb*/intl
and maybe altering PATH and/or CC, e.g. CC=gcc32, but gcc first
in $PATH is the same so that shouldn't matter here, by far.
 
 
 
Thanks,
- Jay


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

end of thread, other threads:[~2009-02-23 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23  2:32 warning/error about possibly uninitialized 'exact' in find_line_symtab Jay
2009-02-23  4:07 ` Joel Brobecker
2009-02-23 18:12   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox