#include <stdio.h>
void a(signed char a) {
printf("%u\n", a);
}
void b(short b) {
printf("%u\n", b);
}
void c(int c) {
printf("%u\n", c);
}
void d(long d) {
printf("%u\n", d);
}
void e(long long e) {
printf("%u\n", e);
}
int main() {
a(-1); //no warning
b(-1); //no warning
c(-1); //no warning
d(-1); //warning
e(-1); //warning
return 0;
}
Compiled and tested with gcc 11.2.0 using gcc -std=c17 -pedantic -Wall -Wextra test.c and g++ -std=c++17 -pedantic -Wall -Wextra test.cpp. Both don't give any warning to a(), b(), and c(). Is this intended, or a bug?