none
How to avoid compiler warning 4091 typedef ignored to left of 'NGenHintEnum' in corhdr.h

    Question

  • The header file, microsoft sdks\windows\v7.1a\include\corhdr.h, causes a couple of 4091 warnings that typedef is not necessary:

    1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\corhdr.h(1772): warning C4091: 'typedef ': ignored on left of 'NGenHintEnum' when no variable is declared
    1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\corhdr.h(1781): warning C4091: 'typedef ': ignored on left of 'LoadHintEnum' when no variable is declared

    Since I build so that warnings are considered errors, I want to remove these warnings but they are in a Microsoft-provided system header file. I haven't seen any update to this file, so I'm wondering how I can ignore these or apply a fix?

    Bob

    Monday, March 20, 2017 8:49 PM

All replies

  • Hi Bob-Uva,

    This forum discusses and asks questions about issues regarding the very core of .NET, Since your issue is more related to C++, we'll move it to C++ forum for suitable support.

    Thanks for your understanding and cooperation.

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 21, 2017 1:23 AM
  • Hi Bob-Uva,

    thanks for posting here.

    >>so I'm wondering how I can ignore these or apply a fix?

    Could you please provide more information about your codes where got this issue?

    Warning C4091 means compiler detected a situation where the user probably intended a variable to be declared, but the compiler was not able to declare the variable. Maybe you're using some user-defined type declarations when you use typedef.

    If you want to ignore this warning, you could try this statement in your code.

    #pragma warning( disable : 4091 )

    Hope this could be help of you.

    Best Regards,

    Sera Yu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 21, 2017 1:28 AM
    Moderator