summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgutils.nim2
-rw-r--r--compiler/condsyms.nim1
-rw-r--r--compiler/nim.cfg4
3 files changed, 6 insertions, 1 deletions
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim
index e19fccfa7..d86ebe461 100644
--- a/compiler/ccgutils.nim
+++ b/compiler/ccgutils.nim
@@ -53,7 +53,7 @@ proc hashString*(conf: ConfigRef; s: string): BiggestInt =
     a = a + (a shl 3)
     a = a xor (a shr 11)
     a = a + (a shl 15)
-    result = cast[Hash](a)
+    result = cast[Hash](uint(a))
 
 template getUniqueType*(key: PType): PType = key
 
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim
index 9d081ef0a..24c6d82d5 100644
--- a/compiler/condsyms.nim
+++ b/compiler/condsyms.nim
@@ -146,6 +146,7 @@ proc initDefines*(symbols: StringTableRef) =
   defineSymbol("nimHasCallsitePragma")
   defineSymbol("nimHasAmbiguousEnumHint")
 
+  defineSymbol("nimHasWarnCastSizes")
   defineSymbol("nimHasOutParams")
   defineSymbol("nimHasSystemRaisesDefect")
   defineSymbol("nimHasWarnUnnamedBreak")
diff --git a/compiler/nim.cfg b/compiler/nim.cfg
index 96b47b0e6..b9c8fdc08 100644
--- a/compiler/nim.cfg
+++ b/compiler/nim.cfg
@@ -31,6 +31,10 @@ define:useStdoutAsStdmsg
   warning[ObservableStores]:off
 @end
 
+@if nimHasWarnCastSizes:
+  warning[CastSizes]:on
+@end
+
 @if nimHasWarningAsError:
   warningAsError[GcUnsafe2]:on
 @end