diff --git a/gbs-downloader.cabal b/gbs-downloader.cabal
index 41af684fd92fc405db488869208e688dace67ac4..1bfed99021e858773ed0c84632dbf20ae3abbd2c 100644
--- a/gbs-downloader.cabal
+++ b/gbs-downloader.cabal
@@ -58,11 +58,20 @@ extra-doc-files: CHANGELOG.md
 -- extra-source-files:
 
 common warnings
-  ghc-options: -Wall
+  ghc-options: -Wall -Werror
+
+common language
+  -- LANGUAGE extensions used by modules in all targets.
+  default-extensions:
+    NamedFieldPuns
+    OverloadedStrings
+    RecordWildCards
 
 library
   -- Import common warning flags.
-  import:           warnings
+  import:
+    warnings
+    , language
 
   -- Modules exported by the library.
   exposed-modules:  Tahoe.Download
@@ -90,7 +99,9 @@ library
 
 executable gbs-downloader
   -- Import common warning flags.
-  import:           warnings
+  import:
+    warnings
+    , language
 
   -- .hs or .lhs file containing the Main module.
   main-is:          Main.hs
@@ -114,27 +125,24 @@ executable gbs-downloader
 
 test-suite gbs-downloader-test
   -- Import common warning flags.
-  import:             warnings
+  import:
+    warnings
+    , language
 
   -- Base language which the package is written in.
-  default-language:   Haskell2010
+  default-language: Haskell2010
 
   -- Modules included in this executable, other than Main.
   -- other-modules:
 
-  -- LANGUAGE extensions used by modules in this package.
-  default-extensions:
-    OverloadedStrings
-    RecordWildCards
-
   -- The interface type and version of the test suite.
-  type:               exitcode-stdio-1.0
+  type:             exitcode-stdio-1.0
 
   -- Directories containing source files.
-  hs-source-dirs:     test
+  hs-source-dirs:   test
 
   -- The entrypoint to the test suite.
-  main-is:            Spec.hs
+  main-is:          Spec.hs
 
   -- Test dependencies.
   build-depends: