Topic: help with tfm.c

I've been porting tfm.c these days. I'm getting a compiler error on line 294.

typedef unsigned long long ulong64

if I remove one of the 'long' from that line it compiles but then I get a new warning

warning: right shift count >= width of type

which I assume is because the variable type is wrong (not big enough)

please enlighten me todd  big_smile

Share

Re: help with tfm.c

fp_word needs to be at least twice as big as fp_digit.

So fp_word should be the biggest size the compiler allows (usually 64 bits, but can be 16, 32, or even 128).

Then fp_digit should be the type that is half that size, 32 bits in the normal case.

Share

Re: help with tfm.c

my compiler doesn't like this syntax and i've never seen it before. is it ANSI C? the 'long long' part?

typedef unsigned long long ulong64

Share

Re: help with tfm.c

Yes, long long is part of ANSI C99: http://en.wikipedia.org/wiki/C99 .

But it's okay if it doesn't work, it's only on one line.  As long as you ensure fp_word is twice the size of fp_digit (independent of actual types) you should be fine.

Share

Re: help with tfm.c

aah, we are using a very old GCC. Understandable why its confused.

Share