From: Jay <jay.krell@cornell.edu>
To: <gdb-patches@sourceware.org>
Subject: warning/error about possibly uninitialized 'exact' in find_line_symtab
Date: Mon, 23 Feb 2009 02:32:00 -0000 [thread overview]
Message-ID: <COL101-W1933E09AB4823F62D01186E6AE0@phx.gbl> (raw)
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
next reply other threads:[~2009-02-23 1:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-23 2:32 Jay [this message]
2009-02-23 4:07 ` Joel Brobecker
2009-02-23 18:12 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=COL101-W1933E09AB4823F62D01186E6AE0@phx.gbl \
--to=jay.krell@cornell.edu \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox