1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: warn when casting number or a voidptr to reference type outside unsafe (#7900)

This commit is contained in:
Nick Treleaven
2021-01-05 18:07:45 +00:00
committed by GitHub
parent 3e04dfc79f
commit 8fc33bc27d
7 changed files with 30 additions and 27 deletions

View File

@@ -81,7 +81,7 @@ pub fn environ() map[string]string {
}
C.FreeEnvironmentStringsW(estrings)
} $else {
e := &charptr(C.environ)
e := unsafe { &charptr(C.environ) }
for i := 0; !isnil(unsafe { e[i] }); i++ {
eline := unsafe { cstring_to_vstring(byteptr(e[i])) }
eq_index := eline.index_byte(`=`)