Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jiang Jilin <freephp@gmail.com>
To: Pierre Muller <muller@ics.u-strasbg.fr>
Cc: Keith Seitz <keiths@redhat.com>,
	tromey@redhat.com, gdb-patches@sourceware.org
Subject: Re: [RFA] Token cleanup in c-exp.y
Date: Tue, 25 Aug 2009 14:10:00 -0000	[thread overview]
Message-ID: <7d77a27d0908250645t7b2c4465y2276c951ae296da4@mail.gmail.com> (raw)
In-Reply-To: <000601ca2568$0eedea60$2cc9bf20$@u-strasbg.fr>

On Tue, Aug 25, 2009 at 5:40 PM, Pierre Muller<muller@ics.u-strasbg.fr> wrote:
>   Just for information:
> doesn't this mean that
> the parser that previously accepted
>  '->  *' with spaces between the arrow and the star,
> will now reject such patterns?
>  Is this also what a C compile would do?

Personally, I think  '->*' is _not_  really a single token or
operation like '++' in ISO C Standard, so the patch is _not_ correct.


>  The problem is that I have
> no idea what it stands for...
> and I never saw '->*' nor '.*' in any C sources.

Indeed, we should never see '->*' nor '.*' in C sources, you know, we
can use '->' or '.' to operate any member of a structure directly, so
why do we need '*' to dereference it?

In compiler principle, I think '->*' should result in a syntax error.

Here is a sample:

struct a {
      int a;
      int b;
};

int main(int argc, char **argv)
{
        struct a test;
        test.a = 10;

        test.*a = 2;
}

$ gcc main.c
main.c: In function 'main':
main.c:10: error: expected identifier before '*' token


  reply	other threads:[~2009-08-25 13:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 23:06 Keith Seitz
2009-08-24 23:08 ` Tom Tromey
2009-08-25  5:03   ` Keith Seitz
2009-08-25 13:45     ` Pierre Muller
2009-08-25 14:10       ` Jiang Jilin [this message]
2009-08-25 15:11         ` Andreas Schwab
2009-08-25 15:28 ` Matt Rice
2009-08-25 15:46   ` Tom Tromey
2009-08-25 15:47 ` Tom Tromey
2009-08-25 18:07   ` Keith Seitz
2009-08-25 18:41     ` Tom Tromey
2009-08-25 18:42       ` Keith Seitz

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=7d77a27d0908250645t7b2c4465y2276c951ae296da4@mail.gmail.com \
    --to=freephp@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=muller@ics.u-strasbg.fr \
    --cc=tromey@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