summary refs log tree commit diff stats
path: root/lib/std
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-04-17 21:55:22 +0300
committerGitHub <noreply@github.com>2023-04-17 20:55:22 +0200
commitb0a98cc01e14a33d75866c10c290f63031dc2112 (patch)
tree8d73def13ac7699326e885be4b9bd6260aa454ea /lib/std
parent2621f78b683592dced21cd93aa241deac8a9232f (diff)
downloadNim-b0a98cc01e14a33d75866c10c290f63031dc2112.tar.gz
warn on set types bigger than max size, default to 0..255 for int literals (#21659)
* test implicitly huge set types

refs https://github.com/nim-lang/RFCs/issues/298

* oh my god

* boot at least

* don't error, fix remaining issues, no 2 len arrays

* fix runnable example

* test assuming 0..255 for int literal

* test refactor, add changelog, test
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/sysrand.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/sysrand.nim b/lib/std/sysrand.nim
index eeaa23d72..b5f61372a 100644
--- a/lib/std/sysrand.nim
+++ b/lib/std/sysrand.nim
@@ -194,8 +194,8 @@ elif defined(linux) and not defined(nimNoGetRandom) and not defined(emscripten):
       elif readBytes > 0:
         inc(result, readBytes)
       else:
-        if osLastError().int in {EINTR, EAGAIN}:
-          discard
+        case osLastError().int
+        of EINTR, EAGAIN: discard
         else:
           result = -1
           break