[z88dk-dev] refined fix for "*(double *)var" in vfprintf

Bridge to the z88dk-developers mailing list
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] refined fix for "*(double *)var" in vfprintf

Post by alvin »

I refined the fix in sccz80::primary.c for the double* problem so that previously reported problems with pointer casting should also now work.

The test code cases are:

1. printf of float with classic library

2. Testcase:

#define BIFROSTSPRITE1LIN ((unsigned char *)58056)


int main()
{
*BIFROSTSPRITE1LIN = 100;
}

3.

char *a;

main()
{
static char *c;
int *b;

b = (int *)(a);
b = ((int *)c);
}



Maybe keep an eye on it tonight to see if something else isn't right.



------------------------------------------------------------------------------
stefano
Well known member
Posts: 2151
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I refined the fix in sccz80::primary.c for the double* problem so that previously reported problems with pointer casting should also now work.
Wow, that was a tricky one.. if you were able to fix it you have all my admiration :)



------------------------------------------------------------------------------
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Wow, that was a tricky one.. if you were able to fix it you have all my admiration :)
Well it was an easy fix actually :) Double is the only type that needs to be excluded from dom's fix so it's just another if condition.



------------------------------------------------------------------------------
Post Reply