Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1235 Invalid variables values

closed-rejected
nobody
z80 port (188)
5
2013-05-25
2006-11-14
Anonymous
No

SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.6.0 #4309 (Jul 28 2006) (MINGW32)

Target: Z80

There is compilation (or maybe precompiler???) bug in
Z80 port.

When is used called macro

#define s_Games_SI_ExtPutChar(x,y,ch) \ { \ Ctx->ext_putchar((x), (y), (ch)); \ }

sometimes are x and y invalid and function ext_putchar
is called with wrong values (sometimes = everytimes
from some calls).
This code can be used as temporary bugfix and works
fine with SDCC:

#ifdef SDCC_BUGFIX
#define s_Games_SI_ExtPutChar(x,y,ch) \ { \ s_Games_SI_ExtPutCh(Ctx, (x), (y), (ch)); \ }

static inline void s_Games_SI_ExtPutCh(CTX_S_Games_SI
*Ctx, UINT8 x, UINT8 y, UINT8 ch)
{
Ctx->ext_putchar((x), (y), (ch));
}

Other compilers (GCC, CC65, ...) have no problems with
this source.

Discussion

  • Logged In: YES
    user_id=564030
    Originator: NO

    "(sometimes = everytimes
    from some calls)."

    Please provide compileable sample code containing such a function.

    Philipp

     
  • Maarten Brock
    Maarten Brock
    2008-02-27

    • milestone: --> unreproducable
    • status: open --> closed-rejected
     
  • Maarten Brock
    Maarten Brock
    2008-02-27

    Logged In: YES
    user_id=888171
    Originator: NO

    Where are the definitions of the types and used functions?
    And use of inline C functions wasn't even added to SDCC until 2007-03-27, so I cannot see how this temporary fix can work.

    All in all this is totally unreproducable.
    And since the OP decided to stay anonymous I see no other option but to close this one.