谁能解释上述编译告警的原因?并且如何去掉?工程中加RPC_NO_WINDOWS_H宏的方法除外

解决方案 »

  1.   

    要去掉在:
    project->setting->c/c++下的warning level 可以调的最高的是4什么都会出来了,你不想让它们出来,调到NONE。http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c4115.asp
      

  2.   

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/C4115.asp
      

  3.   

    msdn上说的很详细,如下Compiler Warning (levels 1 and 3) C4115
    'type' : named type definition in parenthesesThe given symbol was used to define a structure, union, or enumerated type inside a parenthetical expression. The scope of this definition may be unexpected.In a C function call, the definition has global scope. In a C++ function 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.This is a level-1 warning with C++ programs or under the /Za ANSI- compatibility command-line option. It is level 3 otherwise.The following example causes this warning:void func(struct S *);  /* warning */This warning can be avoided by declaring or defining the structure outside of the parentheses before the line that caused this warning, as in:struct S;
    void func(struct S *);or:struct S
    {
       int mem;
    };
    void func(struct S *);如果要去掉警告,可以加上下面的语句
    #pragma warning(disable: 4115)