1

All, I was using the RtlZeroMemory to empty the memory in my project. But when I build the project I got a warning says warning C4090: 'function' : different 'const' qualifiers for below code.

RtlZeroMemory(&copiedRelatedObj, FltObjects->Size);

After researching, I found it doesn't matter with this warning, But It stop the build process . How I ignore or disable this warning ? thanks.

Joe.wang
  • 11,537
  • 25
  • 103
  • 180
  • 5
    It does matter, you are attempting to modify a const object. Trust your compiler and fix your code. If you post the code then I'm sure someone will help you fix it. – john Sep 17 '13 at 09:30
  • 2
    How is copiedRelatedObj declared? And what is `FltObjects`? Rather than suppressing the warning, understand it first. – David Heffernan Sep 17 '13 at 09:30
  • @john thanks , you are right , I forgot to check the type define of copiedRelatedObj. It is modified by `const`. I had change its type. thank you David, I already fix it. – Joe.wang Sep 17 '13 at 10:45

1 Answers1

1

With Visual Studio you can disable warning using #pragma

#pragma warning( disable : 4090 )

Or you can do it for all your project via

Project Properties -> C/C++ -> Advanced -> Disable Specific Warnings

You should try to fix your code instead of ignoring this warning.

You should read this thread and this article about compiler warnings.

Community
  • 1
  • 1
Pierre Fourgeaud
  • 14,290
  • 1
  • 38
  • 62