This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Possible parenthesizing bug
- To: egcs at cygnus dot com, schwab at issan dot informatik dot uni-dortmund dot de
- Subject: Re: Possible parenthesizing bug
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 4 Mar 1998 15:08:27 -0500 (EST)
> From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
> Subject: Possible parenthesizing bug
> Date: 04 Mar 1998 10:42:48 +0100
>
> The following line from cp/lex.c:do_scoped_id generates a warning from gcc:
>
> if (parsing && yychar == '(' || yychar == LEFT_RIGHT)
>
> I think it lacks a pair of parentheses. Is that correct?
>
>
> Tue Mar 3 10:27:30 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
>
> * lex.c (do_scoped_id): Fix parenthesizing.
>
This is correct. I asked a similar question just this past
Monday (http://www.cygnus.com/ml/egcs/1998-Mar/0043.html) and Jason
replied:
> From jason@cygnus.com Mon Mar 2 14:46:48 1998
> Received: from cygnus.com (runyon.cygnus.com [205.180.230.5])
> by caipfs.rutgers.edu (8.8.5/8.8.8) with ESMTP id OAA15718
> for <ghazi@caip.rutgers.edu>; Mon, 2 Mar 1998 14:46:46 -0500 (EST)
> Received: from yorick.cygnus.com (yorick.cygnus.com [205.180.230.146])
> by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id LAA15329
> for <ghazi@caip.rutgers.edu>; Mon, 2 Mar 1998 11:46:13 -0800 (PST)
> Received: (jason@localhost) by yorick.cygnus.com (8.8.7/8.6.4) id LAA07175; Mon, 2 Mar 1998 11:46:12 -0800
> To: ghazi@caip.rutgers.edu (Kaveh R. Ghazi)
> Subject: Re: egcs, cp/lex.c warning confusion ...
> References: <199803021925.OAA06053.cygnus.egcs@caip.rutgers.edu>
> From: Jason Merrill <jason@cygnus.com>
> Date: 02 Mar 1998 11:46:10 -0800
> In-Reply-To: ghazi@caip.rutgers.edu's message of 2 Mar 1998 11:36:29 -0800
> Message-ID: <u9k9ackha5.fsf@yorick.cygnus.com>
> Lines: 3
> X-Mailer: Gnus v5.5/Emacs 20.2
> Status: RO
>
> Putting the parens around the || expr is correct.
> Jason
I had planned to submit a patch myself as part of a larger cp
directory cleanup, but we may as well use yours.
--Kaveh
PS: Note I believe this actually changes the behavior of the
expression since without the parens, the && is evaluated first.
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.