Hi Jan,

Jan Waclawek schrieb:
> Is this an error or just me being stupid?

It's a bug - please file a bug report about it.

The bug can be reproduced within the regression
test suite with the code below:


---------8<-----------------------------------------

/** bugxxxxxxx.c
 */
#include <testfwk.h>

#if defined(SDCC) && !defined(SDCC_z80)
#  define XDATA __xdata
#else
#  define XDATA
#endif

XDATA unsigned char *px;
XDATA unsigned char x[3] = {0x80,0x81,0x82};

unsigned char t;

void
incrementpx(void)
{
  px++;
}

void
testMe(void)
{
  px = x;

  if (px == x) {
    incrementpx();
    t = *px;
  } else {
    t = *px;
  }
  ASSERT(t == 0x81);
}


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to