Skip to main content
AChar.3
Associate II
August 10, 2021
Solved

Hi, My unsigned char test = 128. If i watch this in my debug consol on cube ide i see -127.

  • August 10, 2021
  • 2 replies
  • 1384 views

My problem is simple 3 week ago i created an uint_8 value = 128 all work fine i can see 128 

2 week ago now i see -127 so i changed my uint8_t to char and everything work i see 128 again

1 week ago i see -127 so i changed again to unsigned char and everything work i see 128 again

but now once again i see -127 when i create an unsigned char = 128. can someone explain to me how that can be possible

Thanks for you'r help .

Alexis.

This topic has been closed for replies.
Best answer by Peter BENSCH

It's not a bug, it's an Eclipse feature.

It shows the correct value when using number format Default, but interpretes it as (signed) integer with number format Decimal.

Regards

/Peter

2 replies

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
August 10, 2021

It's not a bug, it's an Eclipse feature.

It shows the correct value when using number format Default, but interpretes it as (signed) integer with number format Decimal.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AChar.3
AChar.3Author
Associate II
August 10, 2021

I was a litte bit lost due to the fact that the display changed when i changed from uint8_t to char or unsigned char but yes i m feeling a little silly

Thank you !