Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!mips!apple!amdahl!starsoft!david From: david@starsoft.hou.tx.us (Dave Lowrey) Newsgroups: comp.sys.amiga.programmer Subject: SAS/C #elif bug Message-ID: Date: 12 Jun 91 20:31:54 GMT Article-I.D.: starsoft.david.1187 Organization: Starbound Software Group Lines: 52 I was having some problems getting some code to properly compile. I have isolated the problem to some code involving '#elif' preprocessor statements. The following sample code illustrates the problem: ========================================================= #include #define TEST2 1 main() { int i,j,k; i=j=k=1; #ifdef TEST1 i=2; #elif TEST2 j=2; #else k=2; #endif printf("%d %d %d\n", i, j, k); } ==================================================== Now, I feel that the output should read: 1 2 1 However, SAS/C produces: 1 1 2 My UNIX system at work produces the correct answer (1 2 1). Is this a known SAS/C bug? I am running 5.10a Dave Lowrey ---------------------------------------------------------------------------- These words be mine. The company doesn't care, because I am the company! :-) Dave Lowrey | david@starsoft.hou.tx.us Starbound Software Group | "The large print giveth, the small print Houston, TX | taketh away." -- Tom Waits in "Step Right Up" ---------------------------------------------------------------------------- These words be mine. The company doesn't care, because I am the company! :-) Dave Lowrey | david@starsoft.hou.tx.us Starbound Software Group | "The large print giveth, the small print Houston, TX | taketh away." -- Tom Waits in "Step Right Up"