On Mon, 28 Nov 2005, David Berry wrote:
>> Error: Type mismatch in parameter 'num_argb' at (1). Passing INTEGER(4) to
>> INTEGER(1)
>
> I don't see this error (using FC4 and GCC 4.0.1) - kpg1_frac compiles
> clean. But building the sharable libary gives:
>
> ld: .libs/kpg1_frac.o: relocation R_X86_64_32 against `a local symbol' can
> not be used when making a shared object; recompile with -fPIC
> .libs/kpg1_frac.o: could not read symbols: Bad value
>
> and indeed recompiling kpg1_frac with -fPIC fixes this problem.
Hrm. We went a different route to fix it, but we're not entirely sure why
it worked or why it went wrong in the first place.
The original code was:
MAXBIN = MIN( NUMBIN, NUM_<T>TOI( NUM_INT<T>(
: MIN( NUM_ITO<T>( VAL__MAXI ),
: RANGE / AVELIM / VAL__EPS<T> / 2<CONST> ) ) ) )
I changed it to:
AVESIZE = RANGE / AVELIM / VAL__EPS<T> / 2<CONST>
MAXBIN = MIN( NUMBIN, NUM_<T>TOI( NUM_INT<T>(
: MIN( NUM_ITO<T>( VAL__MAXI ),
: AVESIZE ) ) ) )
It looked like for some reason there was a cast to an INTEGER happening in
all those divisions somewhere, possibly automatically by g95. The problem
is I can't reproduce it with a test program, so I can't tell for sure if
it's a bug in g95 (my version is from a nightly build from last week, so
it's fairly recent).
Colour me puzzled.
Brad.
|