Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
metarutaiga opened this issue Dec 8, 2022 · 0 comments
Open

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

metarutaiga opened this issue Dec 8, 2022 · 0 comments

Comments

@metarutaiga
Copy link

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
@github-actions github-actions bot changed the title the printf showed wrong result the printf showed wrong result (LLVM-222) Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant