This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Bug Report
- To: gsi at skippyii dot compar dot com
- Subject: Re: GCC Bug Report
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 11 Mar 2000 11:52:00 +0100
- CC: matt at gsicomp dot on dot ca, bug-gcc at gnu dot org
- References: <Pine.BSF.4.10.10003110018280.33324-100000@skippyii.compar.com>
> However, according to the C++ text that I have (written by Stroustrup
> -sp?) indicates that the code that I am attempting to write is indeed
> valid.
>
> gcc 2.7.2.3 compiles it correctly, without fault in execution.
> Can someone verify whether this is indeed a nasty byproduct of the
> gcc/egcs merger, or just something that slipped through the cracks?
Hmm. In your code, I see
switch (event->eventType) {
case arrival:
case service:
case departure:
default:
break;
}
In this context, event is
_event *event = new _event;
where _event is defined as
struct _event {
int classEvent;
eventType typeEvent;
int timeInter;
int timeArrival;
int timeService;
int timeWait;
int timeDepart;
};
There is no field "eventType" in this struct. OTOH, there is a
enum eventType { arrival, service, departure };
Hence the error
a3.c:48: invalid use of type decl `enum eventType' as expression
If that is corrected, the other error still remains. This is caused by
a missing curly bracket from the switch statement; what I quoted above
was indeed the curly bracket from the while statement.
If that is also corrected, g++ 2.95 compiles your code just fine. So I
guess I cannot confirm that this is nasty byproduct of the gcc/egcs
merger, or just something that slipped through the cracks.
Isn't it interesting that gcc 2.7 compiled this code?
Martin