<div dir="ltr">Agreed on the 11 v 14 issues.<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 11:17 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">Le lundi 09 mai 2016 19:28:48, vous avez écrit :<br>
> Here is my current take on language standards<br>
><br>
> - I am working on a C++11/14 C99/11 proposal. I despirately want to be<br>
> able to use C++11 to make GDAL more robust<br>
<br>
</span>C++11 is probably OK, but C++14 support is really "new". For Linux distros, we<br>
should try to make GDAL compilable on the current LTS and probably in the case<br>
of Ubuntu last-1 LTS with their default compiler.<br>
<br>
For example RHEL 7 ships with gcc 4.8.X, Ubuntu 14.04 too.<br>
I've checked that gcc 4.8 refuses -std=c++14. It accepts -std=c++1y though, so<br>
some features of C++14 might be available.<br>
<br>
At least for the sake of our CI environements : Travis has no immediate plans<br>
for now to ship with with Ubuntu 16.04 ( <a href="https://github.com/travis-ci/travis-
ci/issues/5821" rel="noreferrer" target="_blank">https://github.com/travis-ci/travis-<br>
ci/issues/5821</a> )<br>
<span class=""><br>
> - As it stands I will vote >>>against<<< my proposal any time soon - until<br>
> with have a bunch of proposals for changes to GDAL that require new<br>
> language versions or someone rewrites my proposal to be much more<br>
> compelling -</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">
</span>Which proposal exactly ? AFAICS in this thread, it was more about polling<br>
opinions.<br></blockquote><div><br></div><div>I have not sent out the doc yet.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><br>
> We have lots of work that we can do to make GDAL maintenance<br>
> / debugging easier that does not require newer language versions<br>
> - We have successfully ( at least in my opinion ) stuck a toe in the C++11<br>
> world with CPL_FINAL, CPL_DISALLOW_COPY_ASSIGN, NULL_AS_NULLPTR, and<br>
> my std::lock_guard<std::mutex> experiments. We can probably do a bit more<br>
> if we are careful.<br>
> - I think having an experimental autotest2 C++11/14 only testing tree might<br>
> be the way to start. Those who want to can try it out or look through what<br>
> is possible and it won't impact the main tree or the existing C++ tests.<br>
><br>
><br>
> I would be happy to start contributing to<br>
> <a href="https://trac.osgeo.org/gdal/browser/trunk/autotest2" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/browser/trunk/autotest2</a>, especially if we call<br>
> it experimental and I can get help with adding a build system. I have<br>
><br>
> >5000 lines of C++ in 32 test files that mostly cover the port directory<br>
><br>
> right now. I got hung up on trying to create a working initial version in<br>
> a separate github tree. Adding it to the existing svn tree would get me<br>
> around that issue (it's an internal work thing). Here is<br>
> cpl_string_test.cc... it's super boring.<br>
><br>
> <a href="https://gist.github.com/schwehr/02128959ee78d56b553defa0a527bdf2" rel="noreferrer" target="_blank">https://gist.github.com/schwehr/02128959ee78d56b553defa0a527bdf2</a><br>
><br>
> It's written using the Google C++ style guide and is based on gunit, gmock<br>
> and glog.<br>
><br>
> - <a href="https://google.github.io/styleguide/cppguide.html" rel="noreferrer" target="_blank">https://google.github.io/styleguide/cppguide.html</a><br>
> - <a href="https://github.com/google/googletest" rel="noreferrer" target="_blank">https://github.com/google/googletest</a><br>
> - <a href="https://github.com/google/glog" rel="noreferrer" target="_blank">https://github.com/google/glog</a><br>
<br>
</span>Are those available as ready to be installable packages ? (thinking about<br>
integration with CI)<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><br></div><div>The people who maintain gunit/gmock prefer that projects package the gunit code inside their repos. </div><div><br></div><div>git clone git@github.com:google/googletest.git<br></div><div>cd googletest</div><div><div>find . -type f | wc -l</div><div> 340</div></div><div><br></div><div><div>du -hs</div><div>8.9M<span class="" style="white-space:pre"> </span>.</div></div><div><br></div><div>e.g. for libais, I just made third_party and put them in side that...</div><div><br></div><div><a href="https://github.com/schwehr/libais/tree/master/third_party">https://github.com/schwehr/libais/tree/master/third_party</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
><br>
> On Mon, May 9, 2016 at 2:33 AM, Mateusz Loskot <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>> wrote:<br>
> > On 7 May 2016 at 19:10, Kurt Schwehr <<a href="mailto:schwehr@gmail.com">schwehr@gmail.com</a>> wrote:<br>
> > >> If we move to a later C++ standard, or even use features of C++98 we<br>
> > >> currently<br>
> > >> don't use, I'd advocate for using things that are obviously making the<br>
> > >> code<br>
> > >> better / more readable. Honestly who finds that<br>
> > >> "std::unique_ptr<int *, std::function<void(char *)>><br>
> > >> Vals(CPLCalloc(256, 0),<br>
> > >> CPLFree);" is obviously more readable, efficient and less error prone<br>
> ><br>
> > than<br>
> ><br>
> > >> "std::vector Vals(256,0)" ?<br>
> > ><br>
> > > This is cart before the horse but... as fast as I can so expect typos.<br>
> ><br>
> > Now<br>
> ><br>
> > > just think of a ~1K long function or method with tons of instances and<br>
> ><br>
> > lots<br>
> ><br>
> > > of places to bailout successfully or as failures. We have > 9K<br>
> > > free/CPLFree/CPLdelete/CPLDestroys that could be < ~100.<br>
> > > [...]<br>
> ><br>
> > ...the very long story short, your desire is to introduce the RAII idiom<br>
> > across GDAL codebase. Awesome!<br>
> > I'm sure 99% of GDAL committers will welcome this idea.<br>
> > Then, **next** question is how we want to implement it:<br>
> > using C++11+ features, home-brewed smart pointer class(es), etc.<br>
> ><br>
> > Upgrading to C++11+ just for the sake of upgrade, makes little sense to<br>
> > me. Especially if folks are not certain about it, don't use those<br>
> > features daily,<br>
> > don't feel comfortable...it may cause more harm.<br>
> ><br>
> > Best regards,<br>
> > --<br>
> > Mateusz Loskot, <a href="http://mateusz.loskot.net" rel="noreferrer" target="_blank">http://mateusz.loskot.net</a><br>
<br>
--<br></div></div></blockquote></div><div class="gmail_signature"></div>
</div></div>