Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!geovision!zyg From: zyg@geovision.UUCP (Zygmunt Wiercioch) Newsgroups: comp.unix.wizards,comp.lang.c,comp.unix.questions Subject: Re: New feature of Ultrix C compilers Message-ID: <192@geovision.UUCP> Date: Sat, 3-Oct-87 12:35:14 EDT Article-I.D.: geovisio.192 Posted: Sat Oct 3 12:35:14 1987 Date-Received: Wed, 7-Oct-87 06:34:15 EDT References: <867@sask.UUCP> Reply-To: zyg@geovision.UUCP (Zygmunt Wiercioch) Organization: Geovision Corporation, Ottawa, Canada Lines: 61 Xref: dciem comp.unix.wizards:4062 comp.lang.c:4330 comp.unix.questions:3773 Summary: VAX C version 1.0 and library searches In article <867@sask.UUCP> coleman@sask.UUCP (Geoff Coleman @ College of Engineering) writes: > >Ok all you experts out there who can explain this new >feature of Ultrix 2.0 and its C compilers. >We just installed Ultrix 2.0 on a uVax-II. Last night I >recompiled a couple of C programs using both the VAX C >compiler and the default comnpiler. The new executables were >~2.5 times the size of the old one. > Did the executables grow with cc and vcc ? I suspect that the executables grew in size only when you used vcc and lk. There is a bug in the vcc/lk combination of VAX C on Ultrix 2.0 (at least the version we have). The problem occurs with modules that include and/or . The vcc compiler marks externals in these headers in such a way that the lk linker brings in all functions having refernces to these externals. The problems are errno in math.h and the io buffer in stdio.h I belive. Can't check, our 2.0 machine is off the net at moment, but try an ln on a simple object file. A simple test comsisting of these three files should show this behaviour: main.c: #include main() { a(); } a.c: #include a() { printf ("Function a was called\n"); } b.c: #include b() { printf("B was called\n"); c(); } Now vcc a and b and place in a library. Note that function c is not in the library. vcc main, and serach the library containing a and b. You will get c as an unresolved. If c were in the library, it would go into the executable. As a result, if you compile and link using vcc, and use libraries, your executables will become huge, since virtally all the functions in your libraries will be dragged in, needed or not. The other big problem I have with VAX C on Ultrix is that it issues warnings about constructs such as: #if 3b2 ... #if tahoe .. which is full of. The lk linker reports all modules which were compiled with warnings, resulting in a lot of junk output. In the lovely VMS LK%W%... style too. :-) VAC C does do a good job of optimizing the code for the VAX architecture, but it is not usable in the current state. Sure hope DEC gets it right with version 1.1. -- Zygmunt Wiercioch 613-722-9518 GeoVision Corp, 350-1600 Carling Ave Ottawa Canada K1Z 8R7 UUCP: ...!utzoo!dciem!nrcaer!cognos!geovision!zyg