You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actionsbot
changed the title
result of 16bit unsigned arithmetics treated as signed
result of 16bit unsigned arithmetics treated as signed (IDFGH-13747)
Sep 20, 2024
Answers checklist.
General issue report
It seems result of unsigned short arithmetics is treated as signed. Consider following code, the u32 example works, but not the u16 example.
volatile unsigned long u32integer1 = 10;
volatile unsigned long u32integer2 = 0xFFFFFFFF;
volatile unsigned short u16integer1 = 10;
volatile unsigned short u16integer2 = 0xFFFF;
void AppTask(void){
if ((u32integer1 - u32integer2) > 10){
printf("u32 works\n");
}else{
printf("u32 does not work\n");
}
if ((u16integer1 - u16integer2) > 10){
printf("u16 works\n");
}else{
printf("u16 does not work\n");
}
}
The text was updated successfully, but these errors were encountered: