Microsoft KB Archive/34859

From BetaArchive Wiki
Knowledge Base Articles  


PRB: C4047 May Occur When a Function Prototype Is Omitted

Q34859



The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE),
    • Microsoft C for MS-DOS, versions 6.0, 6.0a, 6.0ax
    • Microsoft C for OS/2, versions 6.0, 6.0a
    • Microsoft C/C++ for MS-DOS, version 7.0
    • Microsoft Visual C++ for Windows, 16-bit edition, versions 1.0, 1.5
    • Microsoft Visual C++, 32-bit Editions, versions 1.0, 2.0, 4.0, 5.0, 6.0




SYMPTOMS

An attempt to compile an application generates the following message:

C4047 'operator' : different levels of indirection


CAUSE

Here are some items that might cause this error:

  • The code does not specify a required function prototype or the code does not include the header file that contains the prototype,
  • A reference to a variable is misspelled so that another variable is referenced instead of the intended variable.
  • The code assigns a pointer a value of another type without the appropriate type cast.

When the code omits the function declaration/prototype, the compiler creates a default prototype with "int" the assumed return type. When you use the function the C4047 warning may occur; for example, if you assign the function return value to a variable other than an int.

RESOLUTION

Modify the source code to eliminate the cause of the problem.

Additional query words: 8.00 8.00c 9.00

Keywords : kbCompiler kbVC100 kbVC150 kbVC200 kbVC400 kbVC500 kbVC600
Issue type : kbprb
Technology :


Last Reviewed: July 30, 2001