Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!decuac!bacchus.pa.dec.com!mogul From: mogul@wrl.dec.com (Jeffrey Mogul) Newsgroups: comp.unix.ultrix Subject: Re: Porting code gives "unknown size" C compiler error Keywords: MIPS Ultrix V3.1D C pcc cc VAX VAX/Ultrix Message-ID: <1990Nov20.015916.432@wrl.dec.com> Date: 20 Nov 90 01:59:16 GMT References: <62195@unix.cis.pitt.edu> Sender: news@wrl.dec.com (News) Organization: DEC Western Research Lines: 36 In article <62195@unix.cis.pitt.edu> dpl@unix.cis.pitt.edu (David P. Lithgow) writes: >I'm getting a compiler error, and a friend of mine says that >it is a known error, but I can't find the soultion anywhere in the >Ultrix V3.0, V3.1C, V3.1D, or V4.0 documentation, or the >"Release Notes for RISC Processors". ># make prog >cc -O -c prog.c >ccom: Error: prog.c line 583: unknown size > struct exec execb; > -------------------^ This is not a compiler error, it's an unportable part of your program. Vax systems use the old "a.out" object file format, but MIPS systems use a format "similar to standard AT&T System V COFF". (See "man a.out" on your MIPS system for more info on that; "man a.out" on your Vax system for comparison.) On Vax systems (at least, Vax/Ultrix), "struct exec" comes from by way of . Look at /usr/include/exec.h, and you'll see some #ifdef vax controls. I believe that on MIPS/Ultrix, doesn't end up including at all (more #ifdefs), but exec.h file still defines the right structures. Anyway, the "struct exec" declaration doesn't exist in the COFF (MIPS) world, so when you compile your program on a MIPS system, the compiler sees a declaration depending "struct exec" and doesn't know how much space to allocate. (If you had declared it "struct exec *" then the compiler would have thought "aha! a pointer, I know how big those are", but later on you might still have had grief.) Not the best error message in the world, but think "undeclared type" when the compiler says "unknown size" and you should usually be right. It looks like you're going to have to read the MIPS a.out manual page and then #ifdef your sources. -Jeff