[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pb compiling with gcc-2.7.2.3-3



On 11 Jan 1998, Mark W. Eichin wrote:

> Problem is, some programs are hard to change like that (some stuff in
> tetex-bin, for example, does that initialization for an extern in a
> library, so there isn't a main() into which to move the
> initialization...)

	You can initialize variables in a library using a constructor.
Example:
======================================================================
#include <stdio.h>
FILE * stream;
void init_function(void) __attribute__ ((constructor));
void init_function(void)
{
	stream = stdin;
}
======================================================================

	That way, `my_function()' is executed even before `main()'.

> Note, also, that as far as I can tell from the X build, the *only*
> platform ever to have this problem is LynxOS, and that was about as
> marginal a Unix you could get (it's a realtime unix, just this side of
> the unix vs. realtime line from vxworks...)  Even if there isn't a
> standard to back me up [if there is, then this is a bug, plain and
> simple] I'd still argue that it should be fixed since it's going to
> break so much code [as we've learned on this project...]

	Yes, I agree with you.  We should tell this to the glibc
developers.

-- 
Juan Cespedes


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-sparc-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: