dougpuob
dougpuob

Reputation: 23

Failed to disable compiler warning from command line on Visual Studio compiler

I got a weird problem with MSVC9(Microsoft Visual Studio 2008). I CANNOT disable the warning, C4214, with command line by cl.exe, but it works with #pragma warning(disable: 4214) in source code. I tried with another nonstandard extension warning, C4200, it can be disabled both with command line and pragma. Does anyone know why this might be? My complete command

/Od /Oi /GL /D "__WIN32__" /D "_UNICODE" /D "_CRT_SECURE_NO_DEPRECATE=1" /FD /RTC1 /MT /Gy /W4 /WX /wd4115 /wd4127 /wd4214 /wd4200 /nologo /c /Zi /TC /errorReport:prompt

Upvotes: 2

Views: 6876

Answers (2)

Sisir
Sisir

Reputation: 5418

Just use /wd4214 in your command line. That should be sufficient. Checkout this MSDN Documentation.

Upvotes: 2

Revilo
Revilo

Reputation: 60

You could test with: /Od /Oi /GL /D "__WIN32__" /D "_UNICODE" /D "_CRT_SECURE_NO_DEPRECATE=1" /FD /RTC1 /MT /Gy /W4 /WX /wd4115;4127;4214;4200 /nologo /c /Zi /TC /errorReport:prompt

Upvotes: 0

Related Questions