From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] PR 11530: Fix and test case
Date: Fri, 30 Apr 2010 08:20:00 -0000 [thread overview]
Message-ID: <20100430081959.GB12043@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <001b01cae7e5$f46d47d0$dd47d770$@muller@ics-cnrs.unistra.fr>
On Thu, 29 Apr 2010 23:50:15 +0200, Pierre Muller wrote:
> --- src/gdb/gdbtypes.c 21 Apr 2010 23:21:03 -0000 1.189
> +++ src/gdb/gdbtypes.c 29 Apr 2010 21:23:35 -0000
> @@ -1246,6 +1246,13 @@ lookup_struct_elt_type (struct type *typ
> {
> return TYPE_FIELD_TYPE (type, i);
> }
> + else if (!t_field_name || *t_field_name == '\0')
> + {
> + struct type *subtype = lookup_struct_elt_type (
> + TYPE_FIELD_TYPE (type, i), name, 1);
IMO
struct type *subtype;
subtype = lookup_struct_elt_type TYPE_FIELD_TYPE (type, i), name, 1);
> + if (subtype != NULL)
> + return subtype;
> + }
> }
I was now thinking about a possible name clash. As these anonymous
structs/unions are a GNU extension there is no offical standard for it but the
GCC texinfo file describes it as an error which GCC currently does not report.
I have not found a GCC PR for it.
------------------------------------------------------------------------------
(gcc)Unnamed Fields
You must never create such structures that cause ambiguous field
definitions. For example, this structure:
struct {
int a;
struct {
int a;
};
} foo;
It is ambiguous which `a' is being referred to with `foo.a'. Such
constructs are not supported and must be avoided. In the future, such
constructs may be detected and treated as compilation errors.
------------------------------------------------------------------------------
> +struct a
> + {
> + union
> + {
> + int i;
> + };
> + } a;
Possibly to test also `struct' there to get better test coverage.
> +if { ![runto main] } then {
runto_main
But I do not understand how those embedded remote stubs work.
Thanks,
Jan
next prev parent reply other threads:[~2010-04-30 8:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 21:50 Pierre Muller
2010-04-30 8:20 ` Jan Kratochvil [this message]
2010-04-30 11:08 ` Joseph S. Myers
2010-04-30 13:12 ` Pierre Muller
[not found] ` <15700.946111656$1272633144@news.gmane.org>
2010-04-30 17:29 ` Tom Tromey
2010-05-05 21:44 ` Pierre Muller
[not found] ` <28104.8831450336$1273095904@news.gmane.org>
2010-05-07 17:45 ` Tom Tromey
[not found] <36245.8778698512$1272577829@news.gmane.org>
2010-04-30 17:26 ` Tom Tromey
2010-05-05 22:11 ` Pierre Muller
[not found] ` <1723.54181199825$1273097500@news.gmane.org>
2010-05-07 17:45 ` 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=20100430081959.GB12043@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pierre.muller@ics-cnrs.unistra.fr \
/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