Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!swbatl!texbell!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Typeof operator in C (Re: An Interesting View of "Strong" Vs. "Weak" Typing) Message-ID: Date: 14 Jan 90 16:15:27 GMT References: <16678@megaron.cs.arizona.edu> <7106@tank.uchicago.edu> <-K016ODxds13@ficc.uu.net> Reply-To: peter@ficc.uu.net (Peter da Silva) Distribution: usa Organization: Xenix Support, FICC Lines: 18 > Check out the GNU CC compiler. It has a ``typeof'' keyword that looks like > the ``sizeof'' keyword. Yes, seveal people have pointed me at GCC on this one. > #define SWAP(a,b) {typeof (a) tmp; tmp=a; a=b; b=tmp;} ^ ^ Are these parens needed? sizeof doesn't need tham. Does GCC have my other favorite extensions? Anonymous aggregate constants. (execv(prog, (char *){"prog", ...}) The BCPL valof operator. (a = valof { ... return b; }), also known as the anonymous function. Both of these were in BCPL, and the former is in PL/M as well... -- _--_|\ Peter da Silva. +1 713 274 5180. . / \ \_.--._/ Xenix Support -- it's not just a job, it's an adventure! v "Have you hugged your wolf today?" `-_-'