Path: utzoo!attcan!uunet!steinmetz!beowulf!rsbx From: rsbx@beowulf.UUCP (Raymond S Brand) Newsgroups: comp.sys.amiga Subject: Lattice compiler error Keywords: lattice, c, error Message-ID: <197@beowulf.UUCP> Date: 9 Jun 88 21:55:04 GMT Organization: his computer Lines: 80 #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # badc.c # This archive created: Thu Jun 9 17:33:15 1988 # By: Raymond S Brand (his computer) export PATH; PATH=/bin:$PATH if test -f 'badc.c' then echo shar: will not over-write existing file "'badc.c'" else sed 's/^XX//' << \SHAR_EOF > 'badc.c' XX/* XX * This module demostrates the Lattice version 4.01 compiler generating XX * a CXERR: 19 error message; XX * XX * Try compiling this with and without pre-precessor symbol BADCODE XX * defined. XX * XX * Raymond S. Brand XX * XX */ XX XX XX XXtypedef struct hard_point { float hx, hy; } HardPoint; XX XXenum pelem_type { EHeader, EMove, ELine, EArc, ECurve, EClose }; XX XXstruct path_element XX { XX enum pelem_type ptype; XX union { XX HardPoint point; XX struct arc { int dir; HardPoint centre; float radius, from, to; } arc; XX struct bezier { HardPoint x0, x1, x2; } curve; XX } pe; XX struct path_element *next, *last; XX }; XX XXtypedef struct path_element *Path; XX XXextern HardPoint NewHardPoint(); XXextern Path NewPath(); XX XXstatic void Dash (i) XX int i; XX { XX Path p = NewPath(); XX HardPoint move, here, next; XX XX next = here = move = NewHardPoint(); XX XX XX#ifdef BADCODE XX XX next = p->ptype == ELine ? p->pe.point : move; XX XX#else XX XX if (p->ptype == ELine) XX { XX next = p->pe.point; XX } XX else XX { XX next = move; XX } XX XX#endif XX XX } XX SHAR_EOF fi # end of overwriting check # End of shell archive exit 0