delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/05/10:54:43

Date: Sun, 5 Jan 1997 17:44:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Murray Stokely <murray AT southeast DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: How can I reduce the compiled executable size?
In-Reply-To: <32cf2d35.33059217@nntp.southeast.net>
Message-ID: <Pine.SUN.3.91.970105173006.22565K-100000@is>
MIME-Version: 1.0

On Sun, 5 Jan 1997, Murray Stokely wrote:

> the info entry for this says something like it expands the wildcards
> for you?  So does this mean I can safely declare an empty
> __crt_setup_arguments and still use command line args (as long as i
> don't rely on wildcards)?

No, if you want to disable wildcard expansion, you need to define a
function called `__crt0_glob_function' which always returns a null
pointer.  Defining an empty `__crt0_setup_arguments' will have a different
effect: you get `argc' and `argv' as passed to you by DOS.  Programs which
are linked against an empty `__crt0_setup_arguments' cannot be reliably
invoked from other DJGPP programs, because DJGPP uses special tricks to
pass command line longer than 126 characters to subsidiary DJGPP programs,
and all those tricks are implemented inside `__crt0_setup_arguments'.  
If you are sure your program will *never* be spawned by another DJGPP
program, you can define an empty function.  See the library reference for
details. 

Frankly, I think that the above complications make this method dangerous
in the long run and I don't recommend it.  Are you really that annoyed by
the extra 18KB of these functions?  If you are, just use DJP exe packer to
compress your programs.  The real intent of letting you override those 
functions is not to disable them, but to define custom startup code when 
you need that.  Typically, such customized functions do everything the 
standard versions do, and then some.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019