Excuse my lack of C knowledge, but using your proposed macro, what would be the result of calling:
MYMACRO(x,y,x+y)
with your inclusion of typeof()? MYMACRO(x,y,x+y)
with your inclusion of typeof()?As an example:
int main () {
typeof (1.0f + 10) a;
int * b = &a;
}
----- $ g++ test.c
test.c: In function ‘int main()’:
test.c:3: error: cannot convert ‘float*’ to ‘int*’ in initialization
I'm using g++ because it actually spits out type information for incompatible pointers- probably something having to do with it being an error in C++ but valid in C (with a warning, at least in GCC).