because I'm not always casting to a const char *. If it's any easier to imagine the situation, then: somefunc(ffi.cast("somestruct *", something)) -- William =============================== - Shaping clay is easier than digging it out of the ground. http://williamaadams.wordpress.com http://www.thingiverse.com/WilliamAAdams https://github.com/Wiladams ---------------------------------------- > Date: Mon, 28 May 2012 23:25:57 +0200 > From: mike-1205@xxxxxxxxxx > To: luajit@xxxxxxxxxxxxx > Subject: Re: more gc gotchas > > William Adams wrote: > > I have plenty of code that looks something like this: > > > > somefunc(ffi.cast("const char *", lstring)) > > Why do you bother to use a cast at all? The conversion from Lua > strings to const char * is automatic: > > somefunc(lstring) > > --Mike >