Given the following code:
#define MAX(a,b)
({ __typeof__ (a) _a = (a);
__typeof__ (b) _b = (b);
_a > _b ? _a : _b; })
int main() {
short int a=1,b=2;
a=MAX(a,b);
return 0;
}
gcc -Wconversion gives the following warning:
toto.c: In function ‘main’:
toto.c:2:4: warning: conversion from ‘int’ to ‘short int’ may change value [-Wconversion]
2 | ({ __typeof__ (a) _a = (a);
| ^
toto.c:8:5: note: in expansion of macro ‘MAX’
8 | a=MAX(a,b);
Does anybody know why? Eveything is a short int from start to end.