Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!AI.MIT.EDU!tiemann From: tiemann@AI.MIT.EDU (Micheal Tiemann) Newsgroups: gnu.g++.bug Subject: Bugs in GNU C++ Message-ID: <9001101331.AA04966@apple-gunkies.ai.mit.edu> Date: 10 Jan 90 13:31:39 GMT References: <9001091340.AA11043@life.ai.mit.edu> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 57 Date: Dienstag, 9. Januar 1990, 14.33 Uhr und 13 Sekunden MEZ From: XITITKUN%DDATHD21.BITNET@mitvma.mit.edu X-Munix-To: bug-g++@prep.ai.mit.edu We are currently using the GNU C++ compiler version 1.34.2. While using the compiler I discovered the following two problems: 1) The sample program ... an output like `SIZE: 4', but actually, the program doesn't compile at all. #include main() { printf("SIZE: %d\n", sizeof(typeof(* typeof(int[3]) ) ) ); } Starting the compiler with: bin/g++ demo.cc -o demo results in the following error message: In function int main (): demo.cc:5: parse error before `)' Correct. TYPEOF can only be used on expressions. Since * typeof (...) yields a type, TYPEOF cannot again be applied. 2) Initializing a struct parameter with a default value doesn't work, though I could find nothing in the documentation which tells me that this is not supposed to work. The following sample program #include struct example { int a; float b; }; void dummy(example demo ={5, 3.1415}) { printf("Result: %d %f\n", demo.a, demo.b); } main() { example yyy; example xxx = {1, 1.0}; dummy( yyy ); dummy(); dummy( xxx ); } This was a bug. It is now fixed. Thomas Kunz XITITKUN@DDATHD21.BITNET Michael