Path: utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!PURPLE.CS.UCL.AC.UK!T.Day From: T.Day@PURPLE.CS.UCL.AC.UK (Tim Day) Newsgroups: gnu.g++.bug Subject: Problems with Gnu's own examples ??? Message-ID: <8903092200.AA05384@prep.ai.mit.edu> Date: 9 Mar 89 22:19:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 28 I can't get the following to compile (or fail cleanly) under g++ version 1.32.0 (is essentially the example from ``naming an expression's type'' in the manual). ------- #include #define max(a,b) \ ({typedef _ta = (a),_tb = (b); \ _ta _a = (a);_tb _b = (b); \ _a > _b ? _a : _b; }) main() { int a=1,b=2; cout << max(a,b); // Here exit(0); } ------- Error is : In function int main (): ttest.cc:10: Segmentation violation g++: Program c++ got fatal signal 11. Also segmentation faults using a version based on 'typeof'. Using #define max(a,b) ((a)<(b)?(a):(b)) gives no problems