PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 27, 2022

[FIXED] What is the best solution for suppressing warning from a MS include (C4201 in mmsystem.h)

 April 27, 2022     c++, visual-studio, warnings     No comments   

Issue

I am tired of having to look at warnings during our compilations - warnings that come from MS include files.

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\mmsystem.h(1840): warning C4201: nonstandard extension used : nameless struct/union"

I have seen this thread that suggests changing the header itself (but then each of my team mates has to do it and we have to do it on the build server - not to mention it is a glorious HACK)

Is there a better way? I don't want to turn it off globally - just to suppress it for certain files or directories.

Any suggestions?

EDIT For some stupid reason I didn't think I could set warning levels across include files. Thanks - that does the trick.


Solution

Something like

#pragma warning(push, disable: 4201)
#include <mmsystem.h>
#pragma warning(pop)


Answered By - sbi
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing