# How to disable all warnings for one file only?

**URL:** <https://forum.canton.network/t/how-to-disable-all-warnings-for-one-file-only/3197>\
**Category:** App Development\
**Tags:** daml\
**Created:** [September 23, 2021, 10:37am UTC](https://forum.canton.network/t/how-to-disable-all-warnings-for-one-file-only/3197 "2021-09-23T10:37:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Kapolnai](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/richard_kapolnai/32/89_2.png) [@Richard\_Kapolnai](https://forum.canton.network/u/Richard_Kapolnai)\
**Post date:** [September 23, 2021, 10:37am UTC](https://forum.canton.network/t/how-to-disable-all-warnings-for-one-file-only/3197/1 "2021-09-23T10:37:28Z")

</div>

I’d like to keep both warnings in a project, and some code source raising false warnings. So I’d like to disable all warnings for individual files.  
The example for which I’d appreciate a solution is here: [Exception where clause produces warning "Defined but not used: ‘this’" · Issue #11004 · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/issues/11004)  
I already tried these:

```haskell
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -Wno-unused-top-binds #-}
{-# OPTIONS_GHC -Wno-unused-binds #-}
{-# OPTIONS_GHC -Wno-error #-}

{-# OPTIONS -fno-warn-unused-top-binds #-}
{-# OPTIONS -fno-warn-unused-binds #-}
{-# OPTIONS -Wno-unused-top-binds #-}
{-# OPTIONS -Wno-unused-binds #-}
{-# OPTIONS -Wno-error #-}

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 23, 2021, 5:54pm UTC](https://forum.canton.network/t/how-to-disable-all-warnings-for-one-file-only/3197/2 "2021-09-23T17:54:56Z")

</div>

To disable just this warning you need the following:

```haskell
{-# OPTIONS -Wno-unused-matches #-}

```

To find the right warning your best bet is probably to look at [5.2. Warnings and sanity-checking — Glasgow Haskell Compiler 9.0.1 User's Guide](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using-warnings.html#options-sanity) or my short reference (which isn’t exhaustive) at [Making the most out of DAML Compiler warnings](https://discuss.daml.com/t/making-the-most-out-of-daml-compiler-warnings/739#unused-matches-4).

Alternatively, if you just want to undo your `-Wall` there is `-Wno-all`. If you want to undo `-Werror` and go back to warnings instead there is `-Wwarn`.
