From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/RFC] observer tests & GCC 3.4
Date: Thu, 11 Dec 2003 14:24:00 -0000 [thread overview]
Message-ID: <20031211142435.GB26428@nevyn.them.org> (raw)
In-Reply-To: <20031211141416.GB1494@gnat.com>
On Thu, Dec 11, 2003 at 09:14:16AM -0500, Joel Brobecker wrote:
> > The compiler is getting too smart for its own good again. At the end
> > of observer.c, we have a bit of code that used in the
> > gdb.gdb/observer.exp testcase. Since the variables and functions are
> > declared static, the compiler simply optimizes these out. The
> > attached patch fixes this. Objections?
>
> Humph. I don't know of any other way to stop GDB from optimizing
> them out, so no objection from me.
You can do it with GCC-isms (the appropriate one in this case is
__attribute__((__used__))), but I think that Mark's solution is a
better one in this case. Making them global ought to fix the problem
for good (since any compiler which supports shared objects will have to
export them, since something like libthread_db might use them).
> > Index: ChangeLog
> > from Mark Kettenis <kettenis@gnu.org>
> >
> > * observer.c (observer_test_first_observer,
> > observer_test_second_observer, observer_test_third_observer):
> > Don't define as `static'.
> > (observer_test_first_notification_function,
> > observer_test_second_notification_function,
> > observer_test_third_notification_function): Likewise.
>
> --
> Joel
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-12-11 14:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-11 13:55 Mark Kettenis
2003-12-11 14:14 ` Joel Brobecker
2003-12-11 14:24 ` Daniel Jacobowitz [this message]
2003-12-11 14:34 ` Eli Zaretskii
2003-12-12 16:24 ` Mark Kettenis
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=20031211142435.GB26428@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/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