summary refs log tree commit diff stats
path: root/changelogs/changelog_X_XX_X.md
diff options
context:
space:
mode:
authoree7 <45465154+ee7@users.noreply.github.com>2022-08-19 21:40:53 +0200
committerGitHub <noreply@github.com>2022-08-19 15:40:53 -0400
commite8657c7107761fae7a8b5559df3b88165c238a12 (patch)
treeba65f39bf4fd3dd14fb9f695d4d6c01aa9c37ae2 /changelogs/changelog_X_XX_X.md
parent7fe6dedb623b9bc781df9e68b53e354c73034090 (diff)
downloadNim-e8657c7107761fae7a8b5559df3b88165c238a12.tar.gz
make implicit cstring conversions explicit (#19488)
The Nim manual says that an implicit conversion to cstring will
eventually not be allowed [1]:

    A Nim `string` is implicitly convertible to `cstring` for convenience.

    [...]

    Even though the conversion is implicit, it is not *safe*: The garbage collector
    does not consider a `cstring` to be a root and may collect the underlying
    memory. For this reason, the implicit conversion will be removed in future
    releases of the Nim compiler. Certain idioms like conversion of a `const` string
    to `cstring` are safe and will remain to be allowed.

And from Nim 1.6.0, such a conversion triggers a warning [2]:

    A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning.
    This warning will become an error in future versions! Use an explicit conversion
    like `cstring(x)` in order to silence the warning.

However, some files in this repo produced such a warning. For example,
before this commit, compiling `parsejson.nim` would produce:

    /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv]
    /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv]

This commit resolves the most visible `CStringConv` warnings, making the
cstring conversions explicit.

[1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type
[2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
Diffstat (limited to 'changelogs/changelog_X_XX_X.md')
0 files changed, 0 insertions, 0 deletions
om> 2020-09-23 12:44:41 +0200 fix the indentation in `--help` and `--fullhelp` (#15387)' href='/ahoang/Nim/commit/doc/advopt.txt?h=devel&id=fe3211fbcfa6b14a2e2fcd4dfb8664dcf8a1bd21'>fe3211fbc ^
f8dd74a07 ^
2de6e1877 ^
54fe44135 ^

47886978c ^
7072e3ddc ^








7072e3ddc ^
405b86068
54fe44135 ^

d94950ef8 ^
ca4b971bc ^
9502e39b6 ^

27e2ed437 ^
67fac7f1e ^
da1c1a711 ^


e4a3feeb9 ^

06232b7f2 ^

ec6a1125a ^
48eab5370 ^


592f867aa ^

3b1aabdcf ^

592f867aa ^
3b1aabdcf ^


e844e536b ^



51f3ef6cb ^

c739b9192 ^


f8dd74a07 ^
c617479c6 ^
94a4b5728 ^
c617479c6 ^
15440ec74 ^
a0eca7518 ^
27e2ed437 ^



e931f3b5a ^
a0daa7a76 ^
e931f3b5a ^
405b86068

27e2ed437 ^
6bab7a5bd ^

294d5fb56 ^
c617479c6 ^



13b1b19a8 ^
9502e39b6 ^
7ec7731f8 ^

9502e39b6 ^
7ec7731f8 ^

793676856 ^
2ac45a479 ^
8db93fd0a ^
9502e39b6 ^
5e9dd81ba ^
9502e39b6 ^
13b1b19a8 ^
3e25d5f24 ^
7fcf51248 ^
3b7ef2288 ^
27e2ed437 ^
d0edb1826 ^
5e5e4abfe ^
c25ffbf26 ^
bf592c4e9 ^
afeca3d9f ^
9e884c31d ^

9a4f2225c ^

19cab9fa5 ^
27e2ed437 ^



4e3edf583 ^
4ee9816a7 ^
2ac45a479 ^
c3344862b ^
76235348f ^
405b86068
cd2c6128d ^

738c957e9 ^
f1b64e4b9 ^


9ecb1aae8 ^
c5358b0d4 ^

1dc362dcd ^
5893a9195 ^


dfc48e76f ^
5893a9195 ^
ced62f330 ^

eae31a7f8 ^

f7ba7c711 ^
ac0bb605b ^
053309e60 ^
b78699917 ^
3ea644690 ^
c682671fe ^
b462baed6 ^
ee366f174 ^

44e7a7b6c ^

b187caeb8 ^
2ac45a479 ^


a6682de00 ^
531ed2dc3 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164