From: Gautier DOT DeMontmollin AT maths DOT unine DOT ch Newsgroups: comp.os.msdos.djgpp Subject: Re: Excluding Unused Functions from EXE Message-ID: <4KQ08nRFDDtY@nedcu4> Date: 14 Sep 98 21:05:38 MET References: <35FCD776 DOT 759A AT hotmail DOT com> <6tim2b$eel$1 AT wyrm DOT its DOT uow DOT edu DOT au> Organization: University of Neuchatel, Switzerland Lines: 24 NNTP-Posting-Host: 130.125.1.9 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "Brett Porter" writes: > As with every compiler I know of, GCC does not allow this. You have to put > all of the functions in separate source files. All these will be compiled to > .o files and the linker will leave out any .o files that are not referenced. Turbo Pascal and Janus Ada compilers/linkers at least do eliminate every unused data/code in the final EXE. But these languages (Ada, TP) are modular and the linker can be reliabily informed that such and such code in .o files won't be used. > This is mostly relevant to libraries... if you are just writing a normal > project, why do you write functions that you don't use? :) When you have a graphics package, you are not expected to use every routine in it, are you ? -- Gautier -------- Homepage: http://www.unine.ch/math/Personnel/Assistants/Gautier/Montmollin.html Software: http://www.unine.ch/math/Personnel/Assistants/Gautier/Gaut_FTP.htm