I've noticed some argument promotions that seem not to have been made
explicit.  In the code:

int testDifferent(int x, ...);

[...]

char mychar = 5;
short int myshort = 10;
float myfloat = 30.0;
testDifferent(0, mychar, myshort, 15, 20L, 25LL, myfloat);
return 0;

The mychar, myshort, and myFloat arguments in the call to testDifferent()
are to be promoted according to 7.15.1.1:2.  However, this is not happening
explicitly.  Here is the output from CIL:
char mychar ;
short myshort ;
float myfloat ;
{
mychar = (char)5;
myshort = (short)10;
myfloat = (float )30.0;
testDifferent(0, mychar, myshort, 15, 20L, 25LL, myfloat);
return (0);
}

I would have expected:

testDifferent(0, (int)mychar, (int)myshort, 15, 20L, 25LL, (double)myfloat);

The work that I am doing relies on promotions being explicit, so this is
important to me.  Is the intention to support these promotions?  If so,
perhaps I am somehow disabling these inadvertently?  Is my understanding of
the C spec incorrect?  I appreciate any information/advice you can provide.

Thanks!
-Chucky
------------------------------------------------------------------------------

_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to