[gdal-dev] Current SVN doesn't build with VS

Joaquim Luis jluis at ualg.pt
Fri Nov 13 16:10:46 PST 2015


Kurt,

Yes, that fixed it thanks. I see now only this warning

v:\gdal\frmts\hdf4\hdf4imagedataset.cpp(2550) : warning C4701: potentially  
uninitialized local variable 'iWrkNumType' used

but it's probably a false positive. As are ...

v:\gdal\frmts\hdf4\hdf-eos\ehapi.c(449) : warning C4701: potentially  
uninitialized local variable 'sdInterfaceID' used
v:\gdal\frmts\hdf4\hdf-eos\ehapi.c(436) : warning C4701: potentially  
uninitialized local variable 'HDFfid' used
v:\gdal\frmts\hdf4\hdf-eos\ehapi.c(446) : warning C4701: potentially  
uninitialized local variable 'acs' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(2632) : warning C4701: potentially  
uninitialized local variable 'ndims' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(3270) : warning C4701: potentially  
uninitialized local variable 'c_info' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(3281) : warning C4701: potentially  
uninitialized local variable 'chunkDef' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(8618) : warning C4701: potentially  
uninitialized local variable 'rank' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9568) : warning C4701: potentially  
uninitialized local variable 'xdum' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9070) : warning C4701: potentially  
uninitialized local variable 'j' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9569) : warning C4701: potentially  
uninitialized local variable 'ydum' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9685) : warning C4701: potentially  
uninitialized local variable 'size' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9847) : warning C4701: potentially  
uninitialized local variable 'xdum' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(9848) : warning C4701: potentially  
uninitialized local variable 'ydum' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(10113) : warning C4701: potentially  
uninitialized local variable 'nRetn' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(6501) : warning C4701: potentially  
uninitialized local variable 'yMtr0' used
v:\gdal\frmts\hdf4\hdf-eos\gdapi.c(6500) : warning C4701: potentially  
uninitialized local variable 'xMtr0' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(4282) : warning C4701: potentially  
uninitialized local variable 'nVal' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(5839) : warning C4701: potentially  
uninitialized local variable 'j' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(7267) : warning C4701: potentially  
uninitialized local variable 'incr' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(7301) : warning C4701: potentially  
uninitialized local variable 'offset' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(7271) : warning C4701: potentially  
uninitialized local variable 'index' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(7249) : warning C4701: potentially  
uninitialized local variable 'bufOffset' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(8428) : warning C4701: potentially  
uninitialized local variable 'incr' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(8414) : warning C4701: potentially  
uninitialized local variable 'index' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(9199) : warning C4701: potentially  
uninitialized local variable 'j' used
v:\gdal\frmts\hdf4\hdf-eos\swapi.c(2451) : warning C4701: potentially  
uninitialized local variable 'vdataID' used
xcopy /D /Y *.obj ..\..\o
V:EHapi.obj
V:gctp_wrap.obj
V:GDapi.obj
V:SWapi.obj
4 File(s) copied

V:\gdal\frmts>cd hdf5 && nmake /nologo /f makefile.vc && cd .. || exit 1
cl /Zi /Fd..\..\gdal_w64.pdb /nologo /MD /EHsc /FC  
/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG /W4 /wd4127  
/wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4018 /wd4389  
/DHAVE_SSE_AT_COMPILE_TIME -I..\..\port -I..\..\ogr -I..\..\gcore  
-I..\..\alg -I..\..\ogr\ogrsf_frmts -I..\..\gnm -I..\..\gnm\gnm_frmts  
-I..\..\apps  
-IC:\programs\compa_libs\hdf5-1.8.12\compileds\VC12_64\include -DWIN32  
-D_HDF5USEDLL_ -DOGR_ENABLED -DGDAL_COMPILATION /c hdf5dataset.cpp  
hdf5imagedataset.cpp bagdataset.cpp gh5_convenience.cpp iso19115_srs.cpp
hdf5dataset.cpp
c:\programs\compa_libs\hdf5-1.8.12\compileds\vc12_64\include\h5api_adpt.h(30)  
: warning C4005: '_HDF5USEDLL_' : macro redefinition
command-line arguments : see previous definition of '_HDF5USEDLL_'
v:\gdal\frmts\hdf5\hdf5dataset.cpp(1197) : warning C4244: '*=' :  
conversion from 'hsize_t' to 'unsigned int', possible loss of data
hdf5imagedataset.cpp
c:\programs\compa_libs\hdf5-1.8.12\compileds\vc12_64\include\h5api_adpt.h(30)  
: warning C4005: '_HDF5USEDLL_' : macro redefinition
command-line arguments : see previous definition of '_HDF5USEDLL_'
v:\gdal\frmts\hdf5\hdf5imagedataset.cpp(388) : warning C4267: '=' :  
conversion from 'size_t' to 'int', possible loss of data
bagdataset.cpp
c:\programs\compa_libs\hdf5-1.8.12\compileds\vc12_64\include\h5api_adpt.h(30)  
: warning C4005: '_HDF5USEDLL_' : macro redefinition
command-line arguments : see previous definition of '_HDF5USEDLL_'
v:\gdal\frmts\hdf5\bagdataset.cpp(314) : warning C4267: 'initializing' :  
conversion from 'size_t' to 'int', possible loss of data
v:\gdal\frmts\hdf5\bagdataset.cpp(358) : warning C4244: 'initializing' :  
conversion from 'hsize_t' to 'int', possible loss of data
gh5_convenience.cpp
c:\programs\compa_libs\hdf5-1.8.12\compileds\vc12_64\include\h5api_adpt.h(30)  
: warning C4005: '_HDF5USEDLL_' : macro redefinition
command-line arguments : see previous definition of '_HDF5USEDLL_'
v:\gdal\frmts\hdf5\gh5_convenience.cpp(62) : warning C4267: 'initializing'  
: conversion from 'size_t' to 'int', possible loss of data
iso19115_srs.cpp


> Hi Joaquim,
>
> Yes, MAX should work - that was what was originally in the code.  I'm  
> trying hard to get away from macros and such and get to the most robust  
> code >we can.  I really want to find a way that we can use std::max  
> which is the C++ way to get the maximum value.  I'd like to get macro  
> usage down as far as >possible in the C++ and only use them in pure C  
> code.  There are limits, but std::max shouldn't be one of them.  Any  
> help would be greatly >appreciated.
>
> Thanks!
> -kurt
>
> On Fri, Nov 13, 2015 at 11:28 AM, Joaquim Luis <jluis at ualg.pt> wrote:
>> Hi Kurt,
>>
>> I'll update but later. Now I have to go. Meanwhile I had replaced   
>> std::max by MAX and it passed that point.
>>
>>
>>
>>> Hi Joaquim,
>>>
>>> I broke the build with https://trac.osgeo.org/gdal/changeset/31403/.   
>>> Even created a ticket: https://trac.osgeo.org/gdal/ticket/6212 and I  
>>> added >>>your error message to the ticket.
>>>
>>> http://build.gisinternals.com/sdk/Default.aspx has been down, so it's  
>>> been tough to see what is happening.
>>>
>>> It looks like with my latest fix that the max macro is indeed gone,  
>>> but now it looks like you are hitting trouble with C++11.  I've just  
>>> >>>submitted https://trac.osgeo.org/gdal/changeset/31463 which might  
>>> fix the issue.  Can you do a svn update, try again and let me know  
>>> what you >>>get?
>>>
>>> Thanks,
>>> -kurt
>>>
>>>
>>>
>>> On Fri, Nov 13, 2015 at 10:46 AM, Joaquim Luis <jluis at ualg.pt> wrote:
>>>> The error is
>>>>
>>>> v:\gdal\frmts\hdf4\hdf4imagedataset.cpp(2386) : error C2784: '_Ty  
>>>> std::max(std::initializer_list<_Elem>,_Pr)' : could not deduce  
>>>> template >>>>argument for 'std::initializer_list<_Elem>' from 'int'
>>>>        c:\program files (x86)\microsoft visual studio  
>>>> 12.0\vc\include\algorithm(4108) : see declaration of 'std::max'
>>>>
>>>> Joaquim
>>>> _______________________________________________
>>>> gdal-dev mailing list
>>>> gdal-dev at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>
>>>
>>>
>>> ----
>>> http://schwehr.org
>>
>>
>>
>
>
>
> ----
> http://schwehr.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151114/3ed0bff5/attachment-0001.html>


More information about the gdal-dev mailing list