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

checker: deprecate using V strings in C function calls (#10140)

This commit is contained in:
Enzo
2021-05-20 08:17:44 +02:00
committed by GitHub
parent b0de1f76e8
commit 906b207e58
13 changed files with 27 additions and 25 deletions

View File

@@ -3506,7 +3506,7 @@ fn my_callback(arg voidptr, howmany int, cvalues &&char, cnames &&char) int {
fn main() {
db := &C.sqlite3(0) // this means `sqlite3* db = 0`
// passing a string literal to a C function call results in a C string, not a V string
C.sqlite3_open('users.db', &db)
C.sqlite3_open(c'users.db', &db)
// C.sqlite3_open(db_path.str, &db)
query := 'select count(*) from users'
stmt := &C.sqlite3_stmt(0)