Help with VC++ 6.0 compiler warning
Posted: 17 Jan 2006, 03:32
I have drastically reduced level 4 warnings (using the MS VC++ 6.0 compiler). I started with more than 200 warnings. I want to eliminate all of them! My program is written in C. I'm getting a warning that confounds me. Here it is:
Compiling...
Horizon.c
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses
Linking...
Horizon.exe - 0 error(s), 1 warning(s)
I've found this reference at microsoft.com:
http://msdn2.microsoft.com/en-us/library/hhzc0806.aspx
which states:
Compiler Warning (levels 1 and 4) C4115
"The given symbol is used to define a structure, union, or enumerated type inside a parenthetical expression. The scope of the definition may be unexpected. In a C function call, the definition has global scope. In a C++ call, the definition has the same scope as the function being called. This warning can also be caused by declarators within parentheses (such as prototypes) that are not parenthetical expressions."
None of my code has an obvious need for rpcasync.h, so I would assume VC++ is automatically including it for some reason.
The offending line from rpcasynch.h:
My questions:
* Where does this warning come from?
* What causes it?
* How do I make it go away?
Thanks,
Ron
Compiling...
Horizon.c
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses
Linking...
Horizon.exe - 0 error(s), 1 warning(s)
I've found this reference at microsoft.com:
http://msdn2.microsoft.com/en-us/library/hhzc0806.aspx
which states:
Compiler Warning (levels 1 and 4) C4115
"The given symbol is used to define a structure, union, or enumerated type inside a parenthetical expression. The scope of the definition may be unexpected. In a C function call, the definition has global scope. In a C++ call, the definition has the same scope as the function being called. This warning can also be caused by declarators within parentheses (such as prototypes) that are not parenthetical expressions."
None of my code has an obvious need for rpcasync.h, so I would assume VC++ is automatically including it for some reason.
The offending line from rpcasynch.h:
- Code: Select all
RPCNOTIFICATION_ROUTINE (
struct _RPC_ASYNC_STATE *pAsync, // <-- line 45
void *Context,
RPC_ASYNC_EVENT Event);
My questions:
* Where does this warning come from?
* What causes it?
* How do I make it go away?
Thanks,
Ron