NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Warning (levels 1 and 3) C4115

'type' : named type definition in parentheses

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.

This is a level-1 warning with C++ programs and C programs compiled under ANSI compatibility (/Za). Otherwise, it is level 3.

Example

void func(struct S *);  /* warning */

You can avoid this warning by declaring or defining the structure outside the parentheses before the line where the warning occurred:

struct S;
void func(struct S *);

or:

struct S
{
   int mem;
};
void func(struct S *);