Re: GHC FFI Return Type Bug

7 Aug
2001
7 Aug
'01
6:59 p.m.
At 2001-08-07 11:13, Carl R. Witty wrote:
You can see that the code for f is: call g andl $255,%eax ret So gcc believes that a function which returns a value of type unsigned char is not responsible for clearing the high 3 bytes of %eax.
This is to be expected; in most cases the caller will not be doing any kind of extension and so the high three bytes won't need to be masked at all. Only the caller knows whether extension is necessary, and (as Sigbjorn points out) whether it needs to do signed or unsigned extension. -- Ashley Yakeley, Seattle WA
8688
Age (days ago)
8688
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ashley Yakeley