From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] Fix Sun compiler compat. for empty structs (PR build/14003)
Date: Tue, 12 Jun 2012 20:48:00 -0000 [thread overview]
Message-ID: <20120612204751.GA13700@host2.jankratochvil.net> (raw)
Hi,
build fails on solaris in infrun.c because of empty inferior_suspend_state struct
http://sourceware.org/bugzilla/show_bug.cgi?id=14003
I do not think the struct should be completely removed as it may suggest where
is appropriate to put some possible new fields.
Tom suggested putting there 'char dummy;' but this degrade normal systems
because of some worse systems.
Providing autoconf check for it seems excessive for me.
Any style issues with this fix?
Thanks,
Jan
2012-06-12 Jan Kratochvil <jan.kratochvil@redhat.com>
PR build/14003
* inferior.h (struct inferior_suspend_state): Comment out.
(struct inferior): Comment out the field suspend.
* infrun.c (struct infcall_suspend_state): Comment out the field
inferior_suspend.
(save_infcall_suspend_state, restore_infcall_suspend_state): Comment
out its assignment.
diff --git a/gdb/inferior.h b/gdb/inferior.h
index dfcbda4..c4ad434 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -395,11 +395,13 @@ struct inferior_control_state
/* Inferior process specific part of `struct infcall_suspend_state'.
- Inferior thread counterpart is `struct thread_suspend_state'. */
+ Inferior thread counterpart is `struct thread_suspend_state'.
struct inferior_suspend_state
{
+ Currently unused and some compilers do not accept empty structures.
};
+ */
/* GDB represents the state of each program execution with an object
called an inferior. An inferior typically corresponds to a process
@@ -430,8 +432,11 @@ struct inferior
struct inferior_control_state control;
/* State of inferior process to restore after GDB is done with an inferior
- call. See `struct inferior_suspend_state'. */
+ call. See `struct inferior_suspend_state'.
+
+ Currently unused and some compilers do not accept empty structures.
struct inferior_suspend_state suspend;
+ */
/* True if this was an auto-created inferior, e.g. created from
following a fork; false, if this inferior was manually added by
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b98e379..81182c2 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6639,7 +6639,10 @@ siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var,
struct infcall_suspend_state
{
struct thread_suspend_state thread_suspend;
+
+ /* Currently unused and some compilers do not accept empty structures.
struct inferior_suspend_state inferior_suspend;
+ */
/* Other fields: */
CORE_ADDR stop_pc;
@@ -6693,7 +6696,10 @@ save_infcall_suspend_state (void)
}
inf_state->thread_suspend = tp->suspend;
+
+ /* Currently unused and some compilers do not accept empty structures.
inf_state->inferior_suspend = inf->suspend;
+ */
/* run_inferior_call will not use the signal due to its `proceed' call with
GDB_SIGNAL_0 anyway. */
@@ -6717,7 +6723,10 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state)
struct gdbarch *gdbarch = get_regcache_arch (regcache);
tp->suspend = inf_state->thread_suspend;
+
+ /* Currently unused and some compilers do not accept empty structures.
inf->suspend = inf_state->inferior_suspend;
+ */
stop_pc = inf_state->stop_pc;
next reply other threads:[~2012-06-12 20:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-12 20:48 Jan Kratochvil [this message]
2012-06-12 21:24 ` Joel Brobecker
2012-06-12 21:52 ` Jan Kratochvil
2012-06-13 6:51 ` [patchv2] " Jan Kratochvil
2012-06-13 8:30 ` Mark Kettenis
2012-06-13 8:49 ` Jan Kratochvil
2012-06-13 14:47 ` Joel Brobecker
2012-06-13 18:19 ` [commit] " Jan Kratochvil
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=20120612204751.GA13700@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--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