[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How is string passed from Lua to C
- From: Peter Odding <peter@...>
- Date: Wed, 07 Dec 2011 17:18:34 +0100
Yes, but it is way too easy to cast the result into (char*), in order
to fix the compilation error...
So the programmer has to understand that it is really forbidden to
modify that string.
C APIs don't hold hands, and they shouldn't need to. If a programmer
adds an explicit cast from a non-mutable value to a mutable value, they
should know what they're doing; the type annotation is there for a