# Warnings as errors

**URL:** <https://forums.unrealengine.com/t/warnings-as-errors/307878>\
**Category:** C++\
**Tags:** warnings, errors, unreal-engine, compiler, question, CPP\
**Created:** [February 24, 2015, 3:06am UTC](https://forums.unrealengine.com/t/warnings-as-errors/307878 "2015-02-24T03:06:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![my\_polaris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@my\_polaris](https://forums.unrealengine.com/u/my_polaris)\
**Post date:** [February 24, 2015, 3:06am UTC](https://forums.unrealengine.com/t/warnings-as-errors/307878/1 "2015-02-24T03:06:33Z")

</div>

I noticed that we cannot set the compiler options to treat warnings as errors (on Windows) while compiling the engine or the game DLL. What is the reason behind this?

Thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_957a4452](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_957a4452](https://forums.unrealengine.com/u/anonymous_user_957a4452)\
**Post date:** [February 24, 2015, 2:47pm UTC](https://forums.unrealengine.com/t/warnings-as-errors/307878/2 "2015-02-24T14:47:52Z")

</div>

Hi,

Yes, option ‘treat warnings as errors’ is disabled. “Clang on Windows does not respect “#pragma warning (error: ####)”, and we are not passing “/WX”, so warnings are not treated as errors when compiling on Windows using Clang right now." (c)

UE4 complies with Unreal Build Tool (UBT). You should look for compiler options in VCToolChain.cs  
Try to add this in line 58

```
Arguments.Append(" /WX");

```

Hope it helps!

---

<div class="post-metadata">

**Author:** ![my\_polaris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@my\_polaris](https://forums.unrealengine.com/u/my_polaris)\
**Post date:** [February 24, 2015, 5:53pm UTC](https://forums.unrealengine.com/t/warnings-as-errors/307878/3 "2015-02-24T17:53:46Z")

</div>

Thanks , will add this.

---

<div class="post-metadata">

**Author:** ![my\_polaris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@my\_polaris](https://forums.unrealengine.com/u/my_polaris)\
**Post date:** [February 24, 2015, 5:54pm UTC](https://forums.unrealengine.com/t/warnings-as-errors/307878/4 "2015-02-24T17:54:07Z")

</div>

Thanks ,

Will add this.
