[comp.sys.mac.programmer] Another LSC 3.0 Question

casseres@apple.com (David Casseres) (04/26/89)

I have what I hope is a simple problem.  In a simple LSC program, I want 
to use the standard function atoi.  This is in the stdio library, and when 
I link it in apparently all the code in the library gets copied, and my 
code segment gets too big!  I can't believe this is supposed to happen.

I rooted through the library sources looking for atoi so that I could build 
a custom library containing just atoi and a few other functions, but I 
couldn't find it.  I think the compiler must be changing it to something 
else.  Aaargh!

For now, I am using an atoi copied from K&R, but this is 
not really the right way to do things.  Am I missing something?

David Casseres

Exclaimer:  Wow!

casseres@apple.com (David Casseres) (04/27/89)

In article <1527@internal.Apple.COM> casseres@apple.com (David Casseres) 
writes:
> I have what I hope is a simple problem.  In a simple LSC program, I want 
> to use the standard function atoi.  This is in the stdio library, and 
when 
> I link it in apparently all the code in the library gets copied, and my 
> code segment gets too big!  I can't believe this is supposed to happen.

Oops, I should have said the unix library, not stdio.

> I rooted through the library sources looking for atoi so that I could 
build 
> a custom library containing just atoi and a few other functions, but I 
> couldn't find it.  I think the compiler must be changing it to something 
> else.  Aaargh!

I subsequently found it, in the unix library.  It then became a simple 
(but annoying) task to make a little library containing just atoi and, for 
good measure, atol.

David Casseres

Exclaimer:  Wow!

siegel@endor.harvard.edu (Rich Siegel) (05/06/89)

In article <1527@internal.Apple.COM> casseres@apple.com (David Casseres) writes:
>I have what I hope is a simple problem.  In a simple LSC program, I want 
>to use the standard function atoi.  This is in the stdio library, and when 
>I link it in apparently all the code in the library gets copied, and my 
>code segment gets too big!  I can't believe this is supposed to happen.

	atoi() is in unix, not stdio. If you put unix in a segment by itself,
everything should work OK. [There's generally not enough room in one segment
for much more than MacTraps and stdio.]

	The sources are in :Library Sources:unix .c files:

		--Rich



~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

 "She told me to make myself comfortable, so I pulled down my pants
 and sat in the pudding." -Emo Phillips
~~~~~~~~~~~~~~~