Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!haven!uvaarpa!mcnc!thorin!alanine.cs.unc.edu!leech From: leech@alanine.cs.unc.edu Newsgroups: comp.lang.c++ Subject: C++ on DECstation 3100 Message-ID: <7864@thorin.cs.unc.edu> Date: 20 Apr 89 21:17:10 GMT Sender: news@thorin.cs.unc.edu Reply-To: leech@alanine.cs.unc.edu () Organization: University Of North Carolina, Chapel Hill Lines: 63 Expires: References: Sender: Followup-To: Keywords: I just finished porting cfront 1.2.1 to our new DECstation 3100s (MIPS CPU). This was a relatively easy port. The size/alignment file is exactly the same as a Sun-4. The only caveat is the treatment of functions using . As usual for non-stack oriented machines, there is magic in the C compiler which recognizes varadic functions and generates different code sequences. In this case, the name 'va_alist' is recognized. Since cfront trashes this name, it must be restored in the intermediate C source before compiling. The only place this problem affects cfront directly is in lib/stream/out.c:form(). First, form() must be modified to use . Here's how this looks in our source: #if dgux | mips /* form() requires varargs on some machines */ #include char *form(va_alist) va_dcl { char *format; register char* buf = bfree; if (max < buf+fld_size) buf = formbuf; va_list args; va_start(args); format = va_arg(args, char *); register ll = vsprintf(buf, format, args); va_end(args); if (0 out.c sed -e 's/_au0_va_alist/va_alist/g' < out.c > out..c cc -c out..c mv out..o out.o Similar code will be required for any user function using varargs. Ideally, this patch would be made to the compiler, but this suffices to get cfront & libC running. -- Jon Leech (leech@cs.unc.edu) __@/ "A compact set can be controlled by a finite police force no matter how dumb." H. Weyl ca. 1938