summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-04-04 22:56:03 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-04-04 22:56:03 +0200
commit9c46927fad6535cf7e172f5af5e93d179cec1020 (patch)
treed632824147076612023979685bebe611697c101c /compiler/semdata.nim
parented44e524b055b985b0941227a61f84dd8fdfcb37 (diff)
downloadNim-9c46927fad6535cf7e172f5af5e93d179cec1020.tar.gz
new feature: ability to turn specific warnings to errors
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r--compiler/semdata.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 7ec4c423f..4d836d8f2 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -21,6 +21,7 @@ type
     notes*: TNoteKinds
     features*: set[Feature]
     otherPragmas*: PNode      # every pragma can be pushed
+    warningAsErrors*: TNoteKinds
 
   POptionEntry* = ref TOptionEntry
   PProcCon* = ref TProcCon
@@ -213,6 +214,7 @@ proc newOptionEntry*(conf: ConfigRef): POptionEntry =
   result.defaultCC = ccDefault
   result.dynlib = nil
   result.notes = conf.notes
+  result.warningAsErrors = conf.warningAsErrors
 
 proc pushOptionEntry*(c: PContext): POptionEntry =
   new(result)
@@ -221,12 +223,14 @@ proc pushOptionEntry*(c: PContext): POptionEntry =
   result.defaultCC = prev.defaultCC
   result.dynlib = prev.dynlib
   result.notes = c.config.notes
+  result.warningAsErrors = c.config.warningAsErrors
   result.features = c.features
   c.optionStack.add(result)
 
 proc popOptionEntry*(c: PContext) =
   c.config.options = c.optionStack[^1].options
   c.config.notes = c.optionStack[^1].notes
+  c.config.warningAsErrors = c.optionStack[^1].warningAsErrors
   c.features = c.optionStack[^1].features
   c.optionStack.setLen(c.optionStack.len - 1)