J
J
jov2012-11-01 18:28:13
C++ / C#
jov, 2012-11-01 18:28:13

warnings in MS Visual Studio 10

Good afternoon. The question is, when compiling a project in ms vs 10, in addition to warnings related directly to my code, a myriad of things fall out


10>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h(13588): warning C4820: tagHW_PROFILE_INFOA: "1"-byte fields added after data member "szHwProfileName"
10>C: \Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h(13593): warning C4820: tagHW_PROFILE_INFOW: "2" byte fields added after data member "szHwProfileName"
10>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h(14754): warning C4820: _FILE_BASIC_INFO: "4"-byte fields added after data member "FileAttributes"
10>C:\Program Files\Microsoft SDKs\Windows\v7 .0A\include\winbase.h(14762): warning C4820: _FILE_STANDARD_INFO: '2'-byte fields added after data member 'Directory'
10>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h(14767): warning C4820: _FILE_NAME_INFO: '2' byte fields added after data member 'FileName'
....
Is it possible to set up disabling warnings that are not directly related to the project files?
PS The software is cross-platform, I compile it with cmake.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tbd, 2012-11-01
@jov

There is no option to turn off external warnings.
ala design should help

#pragma warning(push)                 
#pragma warning(disable : WARNING NUMBER )

// тут любой код источник warning'a
// или можно includ'ить хидеры
#include<file.hpp>

#pragma warning(pop)  

you need to wrap winbase.h in it if you explicitly included it
or any other win-hider that implicitly includes it

I
ixSci, 2012-11-02
@ixSci

If I were you, I would deal with the warning that the MS product gives, on the header of the same MS. To avoid, so to speak. I have never come across a need to wrap standard headers in push/pop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question