Revisiting an issue from a while back, here is patch that addresses CIL's failure to insert cast for 'default argument promotions' for the extra arguments to variadic functions.
Let me know what you think.
Elnatan
|
vararg_casts.patch
Description: Binary data
On May 20, 2010, at 1:10 PM, Chucky Ellison wrote: 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 MailScanner warning: numerical links are often malicious: MailScanner warning: numerical links are often malicious: 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 |
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users