Path: utzoo!attcan!uunet!aplcen!haven!umd5!cgs From: cgs@umd5.umd.edu (Chris G. Sylvain) Newsgroups: comp.os.minix Subject: Compiler Quirks (/usr/lib/opt) Keywords: peephole Message-ID: <5715@umd5.umd.edu> Date: 2 Dec 89 17:35:07 GMT Organization: University of Maryland, College Park Lines: 48 -- In our last episode ;-) --- > Problem #1: The construct "FILE *yyout = stdout;" generates the error > message "illegal initialisation". > > What's the best workaround? I threw a "yyout = stdout;" in main() before I posted, but I wasn't convinced that was "best". It was the consensus of the helpful replies that that was exactly the workaround to use. Thanks to those who kindly responded! -- Today's "episode": Please note the "illegal initialisation" message was generated only for the SECOND construct in the code. It had taken "FILE *yyin = stdin;" on the previous line without complaining. In any case, yyin and yyout are now set separately from their declarations. Problem #2: /usr/lib/opt dies with the error message "assertion failed file peephole.c, line 172". Is there a way around opt? I've turned on as much cdecl debugging code as I can (opt runs out of memory!). I've chmem'ed opt as far as it'll go already (and back a bit again for safety). With the debugging strings in the code, it's now about 12k text, 17k data. Problem #3: The substitute code for NOVARARGS apparently doesn't pick things off the stack properly. Could a ACK guru (or anyone familiar with the ACK stack layout) see what's wrong with these few lines ? /* * it is assumed here that machines which don't have either * or will put its arguments on * the stack in the "usual" way and consequently can grab * the arguments using the "take the address of the first * parameter and increment by sizeof" trick. */ # define VA_DCL(type,var) (var) type var; # define VA_START(list,var,type) (list = (va_list)&(var) , (var)) # define va_arg(list,type) ((type *)(list += sizeof(type)))[-1] # define va_end(p) /* nothing */ typedef char *va_list; ..and I thought this'd be a piece of cake! Silly me!!-) -- --==---==---==-- Rath: A sort of green pig -- ARPA: cgs@umd5.UMD.EDU BITNET: cgs%umd5@umd2 -- -- UUCP: ..!uunet!umd5.umd.edu!cgs --