From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,d055dd2f0172279a X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-16 09:50:40 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!rhein!oink.rhein.de!bnc.net!news.maz.net!pipex!howland.reston.ans.net!swrinde!news.uh.edu!uuneo.neosoft.com!nmtigw!peter From: peter@nmti.com (Peter da Silva) Subject: Re: Alpha compiler bug Message-ID: Sender: peter@nmti.com (peter da silva) Organization: Network/development platform support, NMTI References: <3houb5$8cr@vixen.cso.uiuc.edu> <3hqv3e$qb2@vixen.cso.uiuc.edu> Date: Thu, 16 Feb 1995 17:50:40 GMT In article <3hqv3e$qb2@vixen.cso.uiuc.edu>, Steve Peltz wrote: > In article , Peter da Silva wrote: > >This is actually undefined behaviour for ANSI. All the comma operators > >guarantee is that "temp = a + b" will be evaluated before "temp * (a + b)", > >and similarly for the second expression. > Is this true for an argument list as well? The commas in argument lists are not comma operators and do not generate a sequence point. For example: i = 1; printf("%d, %d", i++, i++); Might generate: 1, 2 2, 1 1, 1 (since this is "undefined behaviour" it might also send dirty pictures to clinton@whitehouse.gov) > Is there any way to force the order for something like this? Generate multiple temporaries. > This is actually > a macro expansion, where in the general case it needs to look like a single > expression (it might be a macro expansion, or it might be a function call). It is considered bad form to pass an expression with a side effect to a macro. You may not be able to use macros in this case. -- Peter da Silva `-_-' Network Management Technology Incorporated 'U` 1601 Industrial Blvd. Sugar Land, TX 77478 USA +1 713 274 5180 "Hast du Heute schon deinen Wolf umarmt?"