Skip to content

the printf showed wrong result (LLVM-222) #63

Open
@metarutaiga

Description

@metarutaiga
clang -target xtensa-lx106-elf -mcpu=esp8266

code

static char number[128];
static char* to_string(int value)
{
  os_sprintf(number, "%d", value);
  return number;
}

static char a = -1;
static signed char b = -1;
static unsigned char c = -1;
char rssi = wifi_station_get_rssi();
a = rssi;
b = rssi;
c = rssi;
os_printf("R:%s\n", to_string(rssi));
os_printf("A:%s\n", to_string(a));
os_printf("B:%s\n", to_string(b));
os_printf("C:%s\n", to_string(c));

result

R:187 <- wrong
A:-69
B:-69
C:187

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions