From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14820 invoked by alias); 13 Jun 2012 06:51:45 -0000 Received: (qmail 14811 invoked by uid 22791); 13 Jun 2012 06:51:43 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jun 2012 06:51:26 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5D6p4Mn023351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Jun 2012 02:51:04 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5D6p0Hd008621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 13 Jun 2012 02:51:02 -0400 Date: Wed, 13 Jun 2012 06:51:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: [patchv2] Fix Sun compiler compat. for empty structs (PR build/14003) Message-ID: <20120613065059.GA11317@host2.jankratochvil.net> References: <20120612204751.GA13700@host2.jankratochvil.net> <20120612212413.GS2687@adacore.com> <20120612215116.GA23941@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120612215116.GA23941@host2.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00386.txt.bz2 On Tue, 12 Jun 2012 23:51:16 +0200, Jan Kratochvil wrote: > On Tue, 12 Jun 2012 23:24:13 +0200, Joel Brobecker wrote: > > A structure type describes a sequentially allocated nonempty > > set of member objects [...] > > oops, OK. emptystruct.c:1:8: warning: struct has no members [-pedantic] > > Perhaps using #if 0 instead might make it looks like a little less unusual, > > not sure... > > While #if 0 is IIRC forbidden in general it would at least permit ctags to > work. Jan 2012-06-13 Jan Kratochvil 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..3945962 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -397,9 +397,11 @@ struct inferior_control_state Inferior thread counterpart is `struct thread_suspend_state'. */ +#if 0 /* Currently unused and empty structures are not valid C. */ struct inferior_suspend_state { }; +#endif /* GDB represents the state of each program execution with an object called an inferior. An inferior typically corresponds to a process @@ -431,7 +433,9 @@ struct inferior /* State of inferior process to restore after GDB is done with an inferior call. See `struct inferior_suspend_state'. */ +#if 0 /* Currently unused and empty structures are not valid C. */ struct inferior_suspend_state suspend; +#endif /* 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..e6b7a5e 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6639,7 +6639,9 @@ siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var, struct infcall_suspend_state { struct thread_suspend_state thread_suspend; +#if 0 /* Currently unused and empty structures are not valid C. */ struct inferior_suspend_state inferior_suspend; +#endif /* Other fields: */ CORE_ADDR stop_pc; @@ -6693,7 +6695,9 @@ save_infcall_suspend_state (void) } inf_state->thread_suspend = tp->suspend; +#if 0 /* Currently unused and empty structures are not valid C. */ inf_state->inferior_suspend = inf->suspend; +#endif /* run_inferior_call will not use the signal due to its `proceed' call with GDB_SIGNAL_0 anyway. */ @@ -6717,7 +6721,9 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state) struct gdbarch *gdbarch = get_regcache_arch (regcache); tp->suspend = inf_state->thread_suspend; +#if 0 /* Currently unused and empty structures are not valid C. */ inf->suspend = inf_state->inferior_suspend; +#endif stop_pc = inf_state->stop_pc;