issue a warning for ptr to cstring conversion[backport] (#20814)
* issue a warning for ptr to cstring conversion[backport] * add a changelog
This commit is contained in:
parent
6007a40eac
commit
8e1181bde5
3 changed files with 11 additions and 0 deletions
|
|
@ -1238,6 +1238,11 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
message(tracked.config, n.info, warnCstringConv,
|
||||
"implicit conversion to 'cstring' from a non-const location: $1; this will become a compile time error in the future" %
|
||||
$n[1])
|
||||
if n.typ.skipTypes(abstractInst).kind == tyCstring and
|
||||
isCharArrayPtr(n[1].typ, true):
|
||||
message(tracked.config, n.info, warnPtrToCstringConv,
|
||||
$n[1].typ)
|
||||
|
||||
|
||||
let t = n.typ.skipTypes(abstractInst)
|
||||
if t.kind == tyEnum:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue