[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Small issue with lfs compiled under mingw
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Thu, 28 Jul 2011 00:00:10 +0200
Hi all!
Some time ago I compiled lfs using mingw "by hand" (the distro came with
a makefile for VC only, so I concocted one) and put lfs.dll in my cpath
for using other libraries that required it - never had problems with it.
Lately I'm cleaning-up my (ugly) makefiles and I rewrote the one for
building lfs, enabling more warnings and performing the test script.
Now I have some issues:
1. compiling lfs.c gives some warnings.
2. running test.lua fails with an assertion.
Compiler: TDM-GCC 4.5.2 under Windows XP (SP2)
Here is the invocation and the warnings:
gcc -Wall -Wextra -pedantic -Waggregate-return -Wbad-function-cast
-Wcast-align -Wcast-qual -Wdeclaration-after-statement
-Wdisabled-optimization -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef
-Wwrite-strings -Wunreachable-code -O2 -DNDEBUG -ansi
-I"G:\root\main\core\Lua\app\Lua-sys\include" -c lfs.c -o lfs.o \
&& gcc -shared -LG:\root\main\core\Lua\app\Lua-sys/bin
-LG:\root\main\core\Lua\app\Lua-sys/lib -O2 -Wall -pedantic -o lfs.dll
lfs.o -llua51 \
&& strip --strip-unneeded lfs.dll
lfs.c: In function '_file_lock':
lfs.c:193:2: warning: implicit declaration of function 'fileno'
lfs.c:193:2: warning: nested extern declaration of 'fileno'
lfs.c: In function 'lfs_g_setmode':
lfs.c:289:3: warning: implicit declaration of function '_fileno'
lfs.c:289:3: warning: nested extern declaration of '_fileno'
lfs.c: In function 'file_utime':
lfs.c:597:16: warning: cast from function call of type 'lua_Number' to
non-matching type 'long int'
lfs.c:598:17: warning: cast from function call of type 'lua_Number' to
non-matching type 'long int'
lfs.c: In function 'push_invalid':
lfs.c:665:54: warning: unused parameter 'info'
And here is the assertion message:
G:\root\main\core\Lua\tools\..\app\Lua51\lua.exe: test.lua:129:
assertion failed!
stack traceback:
[C]: in function 'assert'
test.lua:129: in main chunk
[C]: ?
LuaFileSystem 1.5.0
I wonder if the assertion is a serious issue and if it relates to the
above warnings. Any hint appreciated.
BTW, lfs.dll doesn't seem to be broken, since it behaves the same as
previously. The point of failure in test.lua is the following (with
context):
-- directory explicit close
local iter, dir = lfs.dir(tmp)
dir:close()
assert(not pcall(dir.next, dir)) --<<< line 129
print"Ok!"
so it doesn't seem something serious (it seems dir:close() doesn't
invalidate the dir iterator), but you never know!
TIA
-- Lorenzo