summary refs log tree commit diff stats
path: root/tests/system/tostring.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-16 17:22:51 +0800
committerGitHub <noreply@github.com>2022-11-16 10:22:51 +0100
commit06cd15663d6aed6cbf03a265f546043c47f250d4 (patch)
tree644bcc378c2a044655df58a91058b7c73e478d06 /tests/system/tostring.nim
parent3d692d08f74e41588fa157b006e882f142bd77d4 (diff)
downloadNim-06cd15663d6aed6cbf03a265f546043c47f250d4.tar.gz
fixes ptr to cstring warnings[backport] (#20848)
* fix =#13790 ptr char (+friends) should not implicitly convert to cstring

* Apply suggestions from code review

* first round; compiles on windows

* nimPreviewSlimSystem

* conversion is unsafe, cast needed

* fixes more tests

* fixes asyncnet

* another try another error

* last one

* true

* one more

* why bugs didn't show at once

* add `nimPreviewCstringConversion` switch

* typo

* fixes ptr to cstring warnings[backport]

* add fixes

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Diffstat (limited to 'tests/system/tostring.nim')
-rw-r--r--tests/system/tostring.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/system/tostring.nim b/tests/system/tostring.nim
index cae20865e..bb6e453fb 100644
--- a/tests/system/tostring.nim
+++ b/tests/system/tostring.nim
@@ -47,7 +47,7 @@ import strutils
 
 let arr = ['H','e','l','l','o',' ','W','o','r','l','d','!','\0']
 doAssert $arr == "['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\\x00']"
-doAssert $cstring(addr arr) == "Hello World!"
+doAssert $cast[cstring](addr arr) == "Hello World!"
 
 proc takes(c: cstring) =
   doAssert c == cstring""