KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q34859: C4047 Occurs when Function Prototype Is Omitted or Misnamed

Article: Q34859
Product(s): See article
Version(s): 5.00 5.10 | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 26-AUG-1988

The compiler warning message

"C4047 'operator' : different levels of indirection"

can occur when a function prototype declaration is not specified, when
the header file that contains the declaration is not given in a
#include directive, when a reference to a function is misspelled,
or when a pointer is assigned a value of a different type without
using an appropriate type cast.

When the function declaration is omitted, a default prototype is
created with a return type of int assumed. A later use of the function
then may cause the C4047 warning, such as assigning the return value
of the function to a non-int variable.

If the call to the function is not spelled the same as the name of the
prototype, the prototype will not be referred to, the default
assumption for the function return type will be int, and the warning
may occur.

More information on function prototyping can be found beginning on
Page 169 in Chapter 7 of the "Microsoft C Optimizing Compiler Language
Reference" manual.

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.