-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
There's already b"foo"
syntax for [u8]
literals and I've seen talk of adding s"foo"
for String
literals (perhaps through a syntax extension). If we're going down that path we could also add c"foo"
syntax which could be either a CString
or a *const i8
. This would be useful for interacting with foreign C code. Currently, to call a C function with a string constant I'm using
foo(b"my string\0".as_ptr() as *const i8)
But that's a little cumbersome (and error-prone if I accidentally leave the NUL off).
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.