Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!iuvax!rutgers!att!ihlpb!gregg From: gregg@ihlpb.ATT.COM (Wonderly) Newsgroups: comp.unix.wizards Subject: alloca, builtin! Message-ID: <10347@ihlpb.ATT.COM> Date: 27 Apr 89 13:55:54 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 26 When I was at school, I buddy of mine was playing around looking for compiler bugs in the C compiler on one of our departments research machines. He wrote the following program. main() { int i, j, k; &i = &j; } He then did a cc(1) on the file. Oddly enough, there was no comment from the compiler. He showed this to me and I said humm, that shouldn't work, so we did a cc -S and examined the .s file. The compiler generated a single instruction which loaded the stack/frame pointer with the rvalue of the assignment. Boy were we amazed! BTW the compiler was PCC, and the flavor was Perkin Elmer/Concurrent's XELOS (SYSVR2.1). I never did look through the source to see what was done but we tried other such expressions and discovered that it only works for the very first local variable declared. -- Gregg Wonderly DOMAIN: gregg@ihlpb.att.com AT&T Bell Laboratories UUCP: att!ihlpb!gregg