[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8270) win32: fix conversion error



--f46d044289f661da1905226fa6a2
Content-Type: text/plain; charset=UTF-8

I do not understand, I tested also with mingw64 and here is the result I
get with my patches applied:

$ make
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb.c
mdb.c: In function 'mdb_strerror':
cc1.exe: warning: function may return address of local variable
[-Wreturn-local-addr]
mdb.c:1453:7: note: declared here
  char buf[1024], *ptr = buf;
       ^
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c midl.c
ar rs liblmdb.a mdb.o midl.o
C:\msys64\mingw64\bin\ar.exe: creating liblmdb.a
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized  -fPIC  -c mdb.c -o mdb.lo
mdb.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
 /** @file mdb.c
 ^
mdb.c: In function 'mdb_strerror':
cc1.exe: warning: function may return address of local variable
[-Wreturn-local-addr]
mdb.c:1453:7: note: declared here
  char buf[1024], *ptr = buf;
       ^
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized  -fPIC  -c midl.c -o midl.lo
midl.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
 /** @file midl.c
 ^
gcc  -pthread -shared -o liblmdb.so mdb.lo midl.lo
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb_stat.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mdb_stat.o liblmdb.a  -o mdb_stat
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb_copy.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mdb_copy.o liblmdb.a  -o mdb_copy
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb_dump.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mdb_dump.o liblmdb.a  -o mdb_dump
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb_load.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mdb_load.o liblmdb.a  -o mdb_load
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mtest.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mtest.o liblmdb.a  -o mtest
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mtest2.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mtest2.o liblmdb.a  -o mtest2
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mtest3.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mtest3.o liblmdb.a  -o mtest3
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mtest4.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mtest4.o liblmdb.a  -o mtest4
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mtest5.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   mtest5.o liblmdb.a  -o mtest5


On Mon, Oct 19, 2015 at 8:35 AM, Howard Chu <hyc@symas.com> wrote:

> Ignacio Casal Quinteiro wrote:
>
>> I am ok not fixing the MSVC warnings because it is picky even though some
>> of
>> them might make sense even for mingw, but in this case it is an error and
>> this
>> really small change enable msvc to build without errors. Can't you
>> reconsider
>> the change? Specially since it will build fine with mingw as well.
>>
>
> No, since it will break Unix builds.
>
>>
>> On Sat, Oct 17, 2015 at 7:54 PM, Howard Chu <hyc@symas.com
>> <mailto:hyc@symas.com>> wrote:
>>
>>     nacho.resa@gmail.com <mailto:nacho.resa@gmail.com> wrote:
>>
>>         Full_Name: Ignacio Casal Quinteiro
>>         Version:
>>         OS: Windows 7
>>         URL: ftp://ftp.openldap.org/incoming/
>>         Submission from: (NULL) (2a01:111f:9fa:7f00:864b:f5ff:fe34:ddaa)
>>
>>
>>
>> https://github.com/nice-software/lmdb/commit/076281a2c03356667fca7cce1a898a4f155e3dce
>>
>>
>>     I see no error when compiling with gcc -Wall. Closing this ITS.
>>
>>     --
>>        -- Howard Chu
>>        CTO, Symas Corp. http://www.symas.com
>>        Director, Highland Sun http://highlandsun.com/hyc/
>>        Chief Architect, OpenLDAP http://www.openldap.org/project/
>>
>>
>>
>>
>> --
>> Ignacio Casal Quinteiro
>>
>
>
> --
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/
>



-- 
Ignacio Casal Quinteiro

--f46d044289f661da1905226fa6a2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I do not understand, I tested also with mingw64 and here i=
s the result I get with my patches applied:<br><br>$ make<br>gcc -pthread -=
O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=
=A0=C2=A0 -c mdb.c<br>mdb.c: In function &#39;mdb_strerror&#39;:<br>cc1.exe=
: warning: function may return address of local variable [-Wreturn-local-ad=
dr]<br>mdb.c:1453:7: note: declared here<br>=C2=A0 char buf[1024], *ptr =3D=
 buf;<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^<br>gcc -pthread -O2 -g -W -=
Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 =
-c midl.c<br>ar rs liblmdb.a mdb.o midl.o<br>C:\msys64\mingw64\bin\ar.exe: =
creating liblmdb.a<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -W=
bad-function-cast -Wuninitialized=C2=A0 -fPIC=C2=A0 -c mdb.c -o mdb.lo<br>m=
db.c:1:0: warning: -fPIC ignored for target (all code is position independe=
nt)<br>=C2=A0/** @file mdb.c<br>=C2=A0^<br>mdb.c: In function &#39;mdb_stre=
rror&#39;:<br>cc1.exe: warning: function may return address of local variab=
le [-Wreturn-local-addr]<br>mdb.c:1453:7: note: declared here<br>=C2=A0 cha=
r buf[1024], *ptr =3D buf;<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^<br>gcc=
 -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wunini=
tialized=C2=A0 -fPIC=C2=A0 -c midl.c -o midl.lo<br>midl.c:1:0: warning: -fP=
IC ignored for target (all code is position independent)<br>=C2=A0/** @file=
 midl.c<br>=C2=A0^<br>gcc=C2=A0 -pthread -shared -o liblmdb.so mdb.lo midl.=
lo<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cas=
t -Wuninitialized=C2=A0=C2=A0 -c mdb_stat.c<br>gcc -pthread -O2 -g -W -Wall=
 -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 mdb_=
stat.o liblmdb.a=C2=A0 -o mdb_stat<br>gcc -pthread -O2 -g -W -Wall -Wno-unu=
sed-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 -c mdb_copy.c=
<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast =
-Wuninitialized=C2=A0=C2=A0 mdb_copy.o liblmdb.a=C2=A0 -o mdb_copy<br>gcc -=
pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuniniti=
alized=C2=A0=C2=A0 -c mdb_dump.c<br>gcc -pthread -O2 -g -W -Wall -Wno-unuse=
d-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 mdb_dump.o libl=
mdb.a=C2=A0 -o mdb_dump<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-paramet=
er -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 -c mdb_load.c<br>gcc -pt=
hread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitial=
ized=C2=A0=C2=A0 mdb_load.o liblmdb.a=C2=A0 -o mdb_load<br>gcc -pthread -O2=
 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=
=A0=C2=A0 -c mtest.c<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter =
-Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 mtest.o liblmdb.a=C2=A0 -o =
mtest<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-=
cast -Wuninitialized=C2=A0=C2=A0 -c mtest2.c<br>gcc -pthread -O2 -g -W -Wal=
l -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 mte=
st2.o liblmdb.a=C2=A0 -o mtest2<br>gcc -pthread -O2 -g -W -Wall -Wno-unused=
-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 -c mtest3.c<br>g=
cc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuni=
nitialized=C2=A0=C2=A0 mtest3.o liblmdb.a=C2=A0 -o mtest3<br>gcc -pthread -=
O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=
=A0=C2=A0 -c mtest4.c<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter=
 -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 mtest4.o liblmdb.a=C2=A0 -=
o mtest4<br>gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-functi=
on-cast -Wuninitialized=C2=A0=C2=A0 -c mtest5.c<br>gcc -pthread -O2 -g -W -=
Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized=C2=A0=C2=A0 =
mtest5.o liblmdb.a=C2=A0 -o mtest5<br><br></div><div class=3D"gmail_extra">=
<br><div class=3D"gmail_quote">On Mon, Oct 19, 2015 at 8:35 AM, Howard Chu =
<span dir=3D"ltr">&lt;<a href=3D"mailto:hyc@symas.com"; target=3D"_blank">hy=
c@symas.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span c=
lass=3D"">Ignacio Casal Quinteiro wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
I am ok not fixing the MSVC warnings because it is picky even though some o=
f<br>
them might make sense even for mingw, but in this case it is an error and t=
his<br>
really small change enable msvc to build without errors. Can&#39;t you reco=
nsider<br>
the change? Specially since it will build fine with mingw as well.<br>
</blockquote>
<br></span>
No, since it will break Unix builds.<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><span class=3D"">
<br>
On Sat, Oct 17, 2015 at 7:54 PM, Howard Chu &lt;<a href=3D"mailto:hyc@symas=
.com" target=3D"_blank">hyc@symas.com</a><br></span>
&lt;mailto:<a href=3D"mailto:hyc@symas.com"; target=3D"_blank">hyc@symas.com=
</a>&gt;&gt; wrote:<span class=3D""><br>
<br>
=C2=A0 =C2=A0 <a href=3D"mailto:nacho.resa@gmail.com"; target=3D"_blank">nac=
ho.resa@gmail.com</a> &lt;mailto:<a href=3D"mailto:nacho.resa@gmail.com"; ta=
rget=3D"_blank">nacho.resa@gmail.com</a>&gt; wrote:<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Full_Name: Ignacio Casal Quinteiro<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Version:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 OS: Windows 7<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 URL: <a href=3D"ftp://ftp.openldap.org/incoming=
/" rel=3D"noreferrer" target=3D"_blank">ftp://ftp.openldap.org/incoming/</a=
><br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Submission from: (NULL) (2a01:111f:9fa:7f00:864=
b:f5ff:fe34:ddaa)<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"https://github.com/nice-software/lmd=
b/commit/076281a2c03356667fca7cce1a898a4f155e3dce" rel=3D"noreferrer" targe=
t=3D"_blank">https://github.com/nice-software/lmdb/commit/076281a2c03356667=
fca7cce1a898a4f155e3dce</a><br>
<br>
<br>
=C2=A0 =C2=A0 I see no error when compiling with gcc -Wall. Closing this IT=
S.<br>
<br>
=C2=A0 =C2=A0 --<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0-- Howard Chu<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0CTO, Symas Corp. <a href=3D"http://www.symas.com=
" rel=3D"noreferrer" target=3D"_blank">http://www.symas.com</a><br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0Director, Highland Sun <a href=3D"http://highlan=
dsun.com/hyc/" rel=3D"noreferrer" target=3D"_blank">http://highlandsun.com/=
hyc/</a><br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0Chief Architect, OpenLDAP <a href=3D"http://www.=
openldap.org/project/" rel=3D"noreferrer" target=3D"_blank">http://www.open=
ldap.org/project/</a><br>
<br>
<br>
<br>
<br>
--<br>
Ignacio Casal Quinteiro<br>
</span></blockquote><div class=3D"HOEnZb"><div class=3D"h5">
<br>
<br>
-- <br>
=C2=A0 -- Howard Chu<br>
=C2=A0 CTO, Symas Corp.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"=
http://www.symas.com"; rel=3D"noreferrer" target=3D"_blank">http://www.symas=
.com</a><br>
=C2=A0 Director, Highland Sun=C2=A0 =C2=A0 =C2=A0<a href=3D"http://highland=
sun.com/hyc/" rel=3D"noreferrer" target=3D"_blank">http://highlandsun.com/h=
yc/</a><br>
=C2=A0 Chief Architect, OpenLDAP=C2=A0 <a href=3D"http://www.openldap.org/p=
roject/" rel=3D"noreferrer" target=3D"_blank">http://www.openldap.org/proje=
ct/</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br><div class=
=3D"gmail_signature">Ignacio Casal Quinteiro</div>
</div>

--f46d044289f661da1905226fa6a2--