c++/716: Problem when compiling ddd with g++ on alphaev56-dec-osf4.0d

oukaci@paris.ensam.fr oukaci@paris.ensam.fr
Tue Oct 31 02:26:00 GMT 2000


>Number:         716
>Category:       c++
>Synopsis:       Problem when compiling ddd with g++ on alphaev56-dec-osf4.0d
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 31 02:26:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Building ddd-3.2.1 on alphaev56-dec-osf4.0d
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 2.95.2
on alphaev56-dec-osf4.0d
>Description:
c++  -DHAVE_CONFIG_H -DNDEBUG -O2 -g -W -Wall -trigraphs  -c -I. -I. -I./.. -isystem /usr/include/X11  -o HelpCB.o HelpCB.C
HelpCB.C: In function `void PopupTip(void *, XtIntervalId *)':
HelpCB.C:2155: Internal compiler error in `scan_region', at except.c:2566
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
*** Exit 1
Stop.
>How-To-Repeat:
c++  -DHAVE_CONFIG_H -DNDEBUG -O2 -g -W -Wall -trigraphs  -c -I. -I. -I./.. -isystem /usr/include/X11  -o HelpCB.o HelpCB.C
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-unknown-content-type-cfile; name="helpCB.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="helpCB.C"

Ly8gJElkOiBIZWxwQ0IuQyx2IDEuMTE3IDIwMDAvMDIvMTEgMDk6NTk6MTQgYW5kcmVhcyBFeHAg
JCAgLSotIEMrKyAtKi0KLy8gSW50ZXJhY3RpdmUgSGVscCBDYWxsYmFja3MKCi8vIENvcHlyaWdo
dCAoQykgMTk5OCBUZWNobmlzY2hlIFVuaXZlcnNpdGFldCBCcmF1bnNjaHdlaWcsIEdlcm1hbnku
Ci8vIFdyaXR0ZW4gYnkgQ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