[LLVMdev] Incompatible types at call site

Duncan Sands baldrick at free.fr
Tue Apr 5 23:41:59 PDT 2011


Hi Arushi,

> When it asks for the castOpcode, it assumes both types are unsigned(indicated by
> the false arguments).
>
> Is it correct to assume this?

yes, because the behaviour of the original code was undefined.

Ciao, Duncan.

PS: This is the sort of thing that happens when a function is declared with a
prototype such as
   void *Cyclotomic(void *, long, int)
but the function actually has a different prototype, for example
   void *Cyclotomic(void *, long, long)
and the function is called from a place that has only seen the wrong prototype.
In short, this is usually a bug in the original code.  Confusion between int and
long is common, since on 32 bit platforms they are the same but differ on 64 bit
platforms.  Of course it could also be a compiler bug.  You got this from
compiling Fortran with dragonegg, right?  What was the original code?



More information about the llvm-dev mailing list