Bulletin number: 338 Products affected: D5214A_beta D6214A_beta D7214A_beta Description: Parameters, Floats and a bug Component: icc Date: Tue Aug 14 13:58:19 BST 1990 ----- There is a bug in icc floating point parameter passing. This only applies when using old style C declarations. The following code prints out the wrong value: #include void test(f1, f2) float f1, f2; { printf("%f %f\n", f1, f2); } int main() { float a = 1.0F, b = 2.0F; test(a, b); } The values printed out are 1.0000 and 0.0000. The formal parameter f2 is picked up from the second half of f1 by mistake. Prior to the ANSI standard void test(f1, f2) float f1, f2; { ... } should be intrepreted as void test(f1, f2) double f1, f2; { ... } but now with ANSI C (and no template) it should be interpreted as void test(tmp_f1, tmp_f2) double tmp_f1, tmp_f2; { float f1, f2; f1 = tmp_f1; f2 = tmp_f2; ... } The problem will only be seen in functions which have more than one parameter. The problem will be seen in all parameters beyond the first float. The work around is to declare the parameters double and not float, or use ANSI style templates eg void test(float f1, float f2) { ... }