preprocessor/5513: considers non-nested macro as nested one

alexandervpetrov@hotmail.com alexandervpetrov@hotmail.com
Mon Jan 28 05:06:00 GMT 2002


>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:



More information about the Gcc-prs mailing list