Passing longs 'old-style'

Chris Ridd <RiddCJ> cjr at cs.bham.ac.uk
Sun Mar 25 01:34:33 AEST 1990


In ANSI C, parameters in a variable argument list undergo 'integral
promotion', and each float argument is converted to double.  This is the
same as for 'old-style' functions.

Integral promotion converts a character, short, or bit-field to an int if
possible, otherwise to an unsigned int.

In a situation where sizeof(long) > sizeof(int), how does the integral
promotion work if a long is passed 'old-style'?  What effect does casting
have on the arguments?

   Chris

-- Chris Ridd, Computer Science, Birmingham Uni, UK -- RiddCJ at Cs.Bham.Ac.Uk --

"'It's going to look pretty good, then, isn't it,' said War testily, 'the One
Horseman and Three Pedestrians of the Apocralypse.'" - Sourcery



More information about the Comp.lang.c mailing list