MSVC 6.0 rpcasync.h generates warning 
Author Message
 MSVC 6.0 rpcasync.h generates warning

There seems to be a circular definition in rpcasync.h which gives a
warning message at warning level 4 (/W4) or higher.

Try saving the following three-line do-nothing program as "temp.c" and
compiling it with the command line "cl temp.c /W4":

  #include <rpc.h>
  #include <rpcasync.h>
  void main(void) {}

You will get the message:
C:\PROGRA~1\MICROS~2\VC98\INCLUDE\rpcasync.h(45) : warning C4115:
'_RPC_ASYNC_STATE' : named type definition in parentheses

Can anyone suggest a resolution of this?

     - Rich



Wed, 09 Feb 2005 07:24:08 GMT  
 MSVC 6.0 rpcasync.h generates warning

Quote:

>There seems to be a circular definition in rpcasync.h which gives a
>warning message at warning level 4 (/W4) or higher.

many of MS's headers give warnings at W4.

Quote:
>Try saving the following three-line do-nothing program as "temp.c" and
>compiling it with the command line "cl temp.c /W4":

>  #include <rpc.h>
>  #include <rpcasync.h>
>  void main(void) {}

All this is offtopic in CLC since
1) RPC is not part of C, its an extension, you'd need to ask RPC
questions in a different group
2) MSVC is not C, its an implementation, so you'd need to ask in an MS
programming group
3) void main is not C at all in the first place, the ISO standard
requires main to return an int.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>



Wed, 09 Feb 2005 08:07:17 GMT  
 MSVC 6.0 rpcasync.h generates warning
futhermore, you can just not care of the warnings. It will never stop the
compilation.

--
Merci de nous avoir choisi. - Thanks you for your choice.
Nicos - CHAILLAN Nicolas


www.GroupAKT.com - Hbergement Group.
www.WorldAKT.com - Hbergement de sites Internet


Quote:
> There seems to be a circular definition in rpcasync.h which gives a
> warning message at warning level 4 (/W4) or higher.

> Try saving the following three-line do-nothing program as "temp.c" and
> compiling it with the command line "cl temp.c /W4":

>   #include <rpc.h>
>   #include <rpcasync.h>
>   void main(void) {}

> You will get the message:
> C:\PROGRA~1\MICROS~2\VC98\INCLUDE\rpcasync.h(45) : warning C4115:
> '_RPC_ASYNC_STATE' : named type definition in parentheses

> Can anyone suggest a resolution of this?

>      - Rich



Wed, 09 Feb 2005 10:02:09 GMT  
 MSVC 6.0 rpcasync.h generates warning

Quote:

> There seems to be a circular definition in rpcasync.h which gives a
> warning message at warning level 4 (/W4) or higher.

> Try saving the following three-line do-nothing program as "temp.c" and
> compiling it with the command line "cl temp.c /W4":

>   #include <rpc.h>
>   #include <rpcasync.h>
>   void main(void) {}

> You will get the message:
> C:\PROGRA~1\MICROS~2\VC98\INCLUDE\rpcasync.h(45) : warning C4115:
> '_RPC_ASYNC_STATE' : named type definition in parentheses

> Can anyone suggest a resolution of this?

Yes.  Never use anything written by someone who thinks the return type
of main is 'void'.


Wed, 09 Feb 2005 15:46:22 GMT  
 MSVC 6.0 rpcasync.h generates warning

Quote:

> futhermore, you can just not care of the warnings. It will never stop the
> compilation.

That is VERY poor advice. Every warning should be studied carefully in
case it is something important. Ideally, code should compile with a high
warning level, completely diagnostic free.

Brian Rodenborn



Sat, 12 Feb 2005 01:14:42 GMT  
 MSVC 6.0 rpcasync.h generates warning

Quote:

>> futhermore, you can just not care of the warnings. It will never stop the
>> compilation.
> That is VERY poor advice. Every warning should be studied carefully in
> case it is something important. Ideally, code should compile with a high
> warning level, completely diagnostic free.

Still, warnings should be taken as a symptom that something is wrong,
not as The Great Evil itself. The main goal should not be "eliminate
all warnings at any cost" if it means resorting to silly hacks such as
superfluous casting or voiding main().

--

| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/
"This isn't right. This isn't even wrong."
   - Wolfgang Pauli



Sat, 12 Feb 2005 01:39:58 GMT  
 MSVC 6.0 rpcasync.h generates warning

Quote:

> There seems to be a circular definition in rpcasync.h which gives a
> warning message at warning level 4 (/W4) or higher...
> Can anyone suggest a resolution of this?

I use the following method:

/************************************************************************
 YourProgram.c
 ************************************************************************/
#pragma warning(push, 3) // Set warning level to 3 temporarily
#include <windows.h>     //Include all your system headers
#include <stdarg.h>
#include <stdio.h>
#include <limits.h>
#include <vfw.h>
#pragma warning(pop)    // Set the warning level back to what it was
#include "client.h"     // Include YOUR headers
#include "frmMain.h"
#include "globals.h"

Also, at the end of every source file, I tack on these lines, as well:

/* Include the following warning to remove spurious
   error messages generated by the linker. */
#pragma warning(push, 3)

A lot of people talk about how great Lint is, but I found I couldn't
use it, because of the thousands of warnings it raises for the
Microsoft header files. This is the best I can do to examine level 4
warnings on MY code, while ignoring level 4 warnings on MICROSOFT'S
code. If you know of a better method, I would appreciate hearing about
it. :-)




Sat, 12 Feb 2005 14:24:24 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Using MSVC 5.0 and MSVC 6.0 On One Machine

2. Can I mix MSVC 4.0 and MSVC 6.0?

3. Level 4 warnings, VC4.x and windows.h generating tons of warnings

4. Can't link MSVC generated .lib to Borland C++ application

5. Problem when compiling bison generated C file using msvc cl compiler (with optimisation on

6. MSVC: Linker-warning-error in OVL

7. Crashing OCX on computers with no MSVC 6.0

8. msvc 6.0, Access 2000

9. Error in MSVC 6.0 headers...

10. XP and MSVC ++ 6.0 Crash

11. new to msvc++ 6.0

12. Comiling large HELP files using MSVC 6.0

 

 
Powered by phpBB® Forum Software