Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!chem.ucsd.edu!tps From: tps@chem.ucsd.edu (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <512@chem.ucsd.EDU> Date: 6 Aug 89 06:34:32 GMT References: <10099@mpx2.mpx.com> <93@microsoft.UUCP> <10100@mpx2.mpx.com> <44c53d5b.f9df@gtephx.UUCP> <1351@cbnewsl.ATT.COM> Reply-To: tps@chem.ucsd.edu (Tom Stockfisch) Organization: Chemistry Dept, UC San Diego Lines: 14 In article <1351@cbnewsl.ATT.COM> mpl@cbnewsl.ATT.COM (michael.p.lindner) writes: >> > > fprintf(stderr, "Can't open %s\n", file), exit(2); >Sigh. RTFM! The comma operator guarantees left to right evaluation, >and fprintf(...) and exit(...) ARE valid expressions in C. This is valid dpANS code, but it is not currently portable. Many C compilers do not allow void operands of comma operators. Many libraries also declare exit() to return void. Systems that do both will not accept the above statement. -- || Tom Stockfisch, UCSD Chemistry tps@chem.ucsd.edu