KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q65646: /Zg Prototypes Unsigned Functions as Unsigned Short

Article: Q65646
Product(s): See article
Version(s): 6.00   | 6.00
Operating System(s): MS-DOS |
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 24-OCT-1990

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);

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.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.