This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
FW: C pre-processor crash
- To: "'egcs-bugs at egcs dot cygnus dot com'" <egcs-bugs at egcs dot cygnus dot com>
- Subject: FW: C pre-processor crash
- From: "Fieldhouse, Dirk" <Fieldhouse at logica dot com>
- Date: Fri, 18 Jun 1999 20:30:56 +0100
> As posted to news:gnu.gcc.bug
>
If someone wants to investigate this further please contact me and I'll try
to generate a minimal code file that causes the crash - however it's not
easy because of the context explained below (multiple 3rd party header
files) - together with the associated info requested at
http://egcs.cygnus.com/faq.html.
> /df
>
> ----------
> From: fieldhouse@logica.com[SMTP:fieldhouse@logica.com]
> Sent: 16 June 1999 17:46
> To: fieldhouse@logica.com
> Subject: C pre-processor crash
>
> Has anyone else experienced a C pre-processor recursion crash with sample
> code
> similar to the following:
>
> #define Thingy pr_state_ptr->sv_Thingy
> /* followed by struct def including member sv_Thingy for pr_state_ptr */
> ...
> /* later */
> Thingy = (expression);
> ...
>
> It goes without saying that a simple example like this does not crash and
> in
> fact many similar constructions in the same compilation unit are
> successfully
> handled. These macro definitions are typically generated in large numbers
> by a
> commercial product (OPNET) and so it isn't a matter of
>
> "When I hit myself with this hammer it hurts."
> "So don't hit yourself ..."
>
> However the crash is prevented by changing the code trivially in the
> following
> way:
>
> #define Thingy Thingy_x
> #define Thingy_x pr_state_ptr->sv_Thingy_x
> /* followed by struct def including member sv_Thingy_x for pr_state_ptr */
> ...
> /* later */
> Thingy = (expression);
> ...
>
> I've observed this separately with GCC 2.7.2 on Solaris and egcs 1.1.2 on
> Windows NT.
>
> --
> Dirk Fieldhouse Logica UK Limited
> fieldhouse@logica.com 75 Hampstead Road
> c=gb;a=attmail;p=logica; London NW1 2PL
> o=LOGICA;ou1=UK;s=fieldhouse UK
> +44 (171) 637 9111
>
>