From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30406 invoked by alias); 28 Jan 2002 13:06:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30377 invoked by uid 71); 28 Jan 2002 13:06:02 -0000 Resent-Date: 28 Jan 2002 13:06:02 -0000 Resent-Message-ID: <20020128130602.30375.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, alexandervpetrov@hotmail.com Received:(qmail 28858 invoked by uid 61); 28 Jan 2002 13:01:53 -0000 Message-Id:<20020128130153.28850.qmail@sources.redhat.com> Date: Mon, 28 Jan 2002 05:06:00 -0000 From: alexandervpetrov@hotmail.com Reply-To: alexandervpetrov@hotmail.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: preprocessor/5513: considers non-nested macro as nested one X-SW-Source: 2002-01/txt/msg00980.txt.bz2 List-Id: >Number: 5513 >Category: preprocessor >Synopsis: considers non-nested macro as nested one >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Jan 28 05:06:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Alexander Petrov >Release: gcc version 2.95.1 19990816 (release) >Organization: >Environment: SunOS dionysus 5.7 Generic_106541-02 sun4u sparc SUNW,Ultra-5_10 >Description: Preprocessor considers a non-nested macro as nested one: # define A A_EXP B( # define B() B_EXP A A ) ) produces A_EXP B_EXP A_EXP B( ) and does not expand the last B macro. Like in PR 5498, the expansion of macro B has terminated by the time you get to the second ')', and therefore the second invocation of B is not nested, and B should be re-expanded. The handling of the last parenthesis in "A )" (in PR 5498) condtradicts with handling of the last parenthesis in "A ) )", so the expansion of at least one of these samples is incorrect. >How-To-Repeat: # define A A_EXP B( # define B() B_EXP A A ) ) >Fix: >Release-Note: >Audit-Trail: >Unformatted: