CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2009
    Posts
    4

    unnamed type definition in parentheses

    when I use vc6 to compile a driver.

    I get the error:
    error C4116: unnamed type definition in parentheses

    this is the code that the error point to:
    ProbeForRead(Irp->UserBuffer, pIoStackIrp->Parameters.Write.Length, TYPE_ALIGNMENT(char));

    what does TYPE_ALIGNMENT(char)) mean, and why it case the error?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: unnamed type definition in parentheses

    1. http://www.google.com/search?sourcei...TYPE_ALIGNMENT

    2. From MSDN:
    Compiler Warning (level 1) C4116
    unnamed type definition in parentheses

    A structure, union, or enumerated type with no name was defined in a parenthetical expression. The type definition is meaningless.

    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.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2009
    Posts
    4

    Re: unnamed type definition in parentheses

    Quote Originally Posted by VictorN View Post

    I also want to know why MSDN says it's a "warning" but when I build the code, the IDE prompts me an "error".

  4. #4
    Join Date
    Dec 2008
    Posts
    144

    Re: unnamed type definition in parentheses

    Check your project properties: C/C++->General->Treat warnings as errors.

  5. #5
    Join Date
    Oct 2009
    Posts
    4

    Re: unnamed type definition in parentheses

    Quote Originally Posted by Nikitozz View Post
    Check your project properties: C/C++->General->Treat warnings as errors.
    What I made is a driver,and the project doesn't have that settings.The user mode app is different from driver. I only view the vc6 as a higher editor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured