кусок кода uint32_t cnt = 10;
unsigned short t0 = 1;
unsigned short pt = 8;
if (cnt - t0 >= pt) {
printf("Bum!!!");
}
это с флагами -Wall -Wextra -Wconversion -Wsign-conversion
а вот что будет если заменить unsigned short t0 -> short t0
~/temp$ gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wdouble-promotion -Wfloat-conversion test.cpp -o test
test.cpp: In function ‘int main()’:
test.cpp:11:15: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
11 | if (cnt - t0 >= pt) {
| ^~