Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!kth!sunic!ericom!tnetxa.ericsson.se!eds.ericsson.se!rif_xu From: rif_xu@eds.ericsson.se Newsgroups: comp.sys.mac.programmer Subject: Compiling trouble with Think's LSC Message-ID: <1814@eds.ericsson.se> Date: 27 Jul 89 09:59:27 GMT Lines: 93 /* I'm having some troubles with Think's LSC: a) The program below,which sorts primes out, doesn't give correct results - it even pops out some even numbers ! - when compiled using TLSC 3.01p4. I used the '020 setting and used the MacTraps and the Stdio libs. Includes was of course. I have compiled the same program on our VAX and on MPW C 2.02 and they give the correct result. Why doesn't TLSC compile correctly ? b) I have translated the standard Whetstone benchmark into C. It worked when compiling with the MPW C 2.02 compiler (by the way, I got 830 000 Whets/s on a MACII- anyone beaten that ?) but in TLSC I get the link error 'Code segment too big '. I used the math881,std881 and Mactraps libraries and had the settings for the '881 and '020 on. Can anybody help ? Please mail me... Thanks Sigge Ruschkowski Ericsson Components Sweden /* * Virtual sieve to find primes. Requires only O(sqrt(N)) space to * find primes up to N. * * WARNING: This code assumes that ints are 32 bits * * Arch D. Robison * University of Illinois at Urbana-Champaign * * UUCP: {pur-ee,convex}!uiucdcs!robison * Internet: robison@CS.UIUC.EDU */ #define SQRT_N 100 /* Program prints all primes less than SQRT_N*SQRT_N */ int multiple[SQRT_N/2]; int primes[SQRT_N/2]; int count; int numberofprimes; #define SIEVE_WORDS (1+(SQRT_N-1)/32) int sieve[SIEVE_WORDS]; #define WORD(i) sieve[(i)>>5] #define BIT(i) (1<<(i&0x1F)) #define test_bit(i) (WORD(i)&BIT(i)) #define set_bit(i) (WORD(i)|=BIT(i)) void clear_bits() { /* clear the sieve */ register int i; for( i=0; i= SQRT_N ) { int i; clear_bits(); p_offset = 0; p_base += SQRT_N; for( i=0; i