/Zg Prototypes Unsigned Functions as Unsigned Short

ID Number: Q65646

6.00 | 6.00

MS-DOS |

Summary:

Using the /Zg option on the following code, the compiler will

generate a function prototype for func() that returns an unsigned

short. This is by design and is not a problem if the code is to be

compiled on a machine where ints and short ints are the same size.

Sample Code

-----------

unsigned func(void)

{

unsigned b = 1;

printf("Hello World\n);

return (b);

}

The code generates the following prototype:

unsigned short func (void);

More Information:

Both unsigned and unsigned int specify the same data type; unsigned is

a shortened name for unsigned int. Likewise, unsigned short is another

name for unsigned short int. In the Microsoft C 6.00 implementation,

unsigned/unsigned int and unsigned short/unsigned short int specify

compatible data types.