lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


clang 2.8 complains with this warning a bunch of times:

clang -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ldo.o ldo.c
ldo.c:663:3: warning: _expression_ result unused [-Wunused-value]
  luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ldo.c:17:
In file included from ./lapi.h:12:
In file included from ./lstate.h:14:
In file included from ./lzio.h:13:
./lmem.h:24:35: note: instantiated from:
#define luaM_freearray(L, b, n)   luaM_reallocv(L, (b), n, 0, sizeof((b)[0]))
                                  ^
./lmem.h:19:20: note: instantiated from:
                (luaM_toobig(L), (void *)0) : \
                                 ^       ~

On Thu, Dec 8, 2011 at 10:52 AM, Dimiter 'malkia' Stanev <malkia@gmail.com> wrote:
The CRT source code comes with Visual Studio (probably not with the Express Edition). One can download the VS2011 Preview and in it, just check the

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\stdargv.c"

file, then this function (unicode variant here, there is non-unicode too):

static void __cdecl wparse_cmdline()

It could be that it's behaviour is where close to what CommandLineToArgcW, but the CRT is not using that function.

Probably so that the CRT does not have dependency on SHELL32.dll (where the function comes from).

One thing that MSVCRT implements, if you link with setargv.obj/wsetargv.obj (unicode) is some kind of globbing that is found in Unixes - I've used it in the past - one has just to add setargv.obj somewhere in the linker options.

it's in here, usually part of your LIB env.

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib

Cheers!


On 12/8/2011 6:36 AM, Jerome Vuarand wrote:
2011/12/8 Lorenzo Donati<lorenzodonatibz@interfree.it>:
Running the test suite with:

..\src\lua -e"_U=true" all.lua

was ok, but note that I had to change single quotes into double quotes.
When using (as suggested in http://www.lua.org/tests/5.2/):

..\src\lua -e'_U=true' all.lua

with XP command prompt I got the error:

..\src\lua: (command line):1: unexpected symbol near ''_U=true''

That's because of the way the C runtime library splits command line
and handles quoting. Contrary to Unix, the Windows command lines are
passed as a single string to the called process, and the C runtime
library is splitting it into argc and argv. The C runtime library
you're using seems not to handle single quotes like you expect. If
it's anything like CommandLineToArgcW function [1] (which I believe
the MSVC libc is calling), it only treats double quotes specially and
pass single quotes unchanged (and the string [[ '_U=true' ]] is not
valid Lua code).

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/bb776391.aspx