From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11968 invoked by alias); 25 Aug 2009 13:45:35 -0000 Received: (qmail 11951 invoked by uid 22791); 25 Aug 2009 13:45:34 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_43,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-qy0-f195.google.com (HELO mail-qy0-f195.google.com) (209.85.221.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Aug 2009 13:45:27 +0000 Received: by qyk33 with SMTP id 33so590963qyk.24 for ; Tue, 25 Aug 2009 06:45:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.15.75 with SMTP id j11mr1284032qca.69.1251207925185; Tue, 25 Aug 2009 06:45:25 -0700 (PDT) In-Reply-To: <000601ca2568$0eedea60$2cc9bf20$@u-strasbg.fr> References: <4A9313C2.3050907@redhat.com> <4A9367B2.4040900@redhat.com> <000601ca2568$0eedea60$2cc9bf20$@u-strasbg.fr> From: Jiang Jilin Date: Tue, 25 Aug 2009 14:10:00 -0000 Message-ID: <7d77a27d0908250645t7b2c4465y2276c951ae296da4@mail.gmail.com> Subject: Re: [RFA] Token cleanup in c-exp.y To: Pierre Muller Cc: Keith Seitz , tromey@redhat.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2009-08/txt/msg00412.txt.bz2 On Tue, Aug 25, 2009 at 5:40 PM, Pierre Muller wro= te: > =A0 Just for information: > doesn't this mean that > the parser that previously accepted > =A0'-> =A0*' with spaces between the arrow and the star, > will now reject such patterns? > =A0Is 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. > =A0The 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 =3D 10; test.*a =3D 2; } $ gcc main.c main.c: In function 'main': main.c:10: error: expected identifier before '*' token