Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!aurora!labrea!rocky!andy From: andy@rocky.STANFORD.EDU (Andy Freeman) Newsgroups: comp.lang.c Subject: Re: typeof isn't enough to define swap correctly Message-ID: <576@rocky.STANFORD.EDU> Date: Fri, 11-Sep-87 02:36:17 EDT Article-I.D.: rocky.576 Posted: Fri Sep 11 02:36:17 1987 Date-Received: Sat, 12-Sep-87 16:38:21 EDT References: <557@rocky.STANFORD.EDU> <1880@sol.ARPA> <109@umigw.MIAMI.EDU> <2019@sfsup.UUCP> <2105@sol.ARPA> Reply-To: andy@rocky.UUCP (Andy Freeman) Organization: Stanford University Computer Science Department Lines: 20 In article <2105@sol.ARPA> crowl@cs.rochester.edu (Lawrence Crowl) writes: >Let's try again. I will ignore points 1 and 2 because they are easy. I >will ignore points 3, 4 and 5 because they essentially cannot be fixed. >I will try to address points 6, 7, and 8. Like I said, it is probably impossible to write a correct swap macro. I'm glad you knew yours was wrong before you posted it. BTW - your concat macro doesn't work in all legal implementations of cpp. Changing it to the ANSI c feature designed for that problem doesn't help - your definition doesn't handle point 6 correctly. At least it handles swap(a[i],b[j]), a version someone posted with the concat bug didn't.... -andy -- Andy Freeman UUCP: {arpa gateways, decwrl, sun, hplabs, rutgers}!sushi.stanford.edu!andy ARPA: andy@sushi.stanford.edu (415) 329-1718/723-3088 home/cubicle