<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
pre
{mso-style-priority:99;
mso-style-link:"HTML con formato previo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-language:CA;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
mso-fareast-language:CA;}
span.HTMLconformatoprevioCar
{mso-style-name:"HTML con formato previo Car";
mso-style-priority:99;
mso-style-link:"HTML con formato previo";
font-family:Consolas;
mso-fareast-language:EN-US;}
span.EstiloCorreo22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.checkstep-line-content
{mso-style-name:checkstep-line-content;}
span.EstiloCorreo24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.dt-fm
{mso-style-name:dt-fm;}
span.EstiloCorreo26
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EstiloCorreo27
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EstiloCorreo28
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1101877095;
mso-list-template-ids:-1365501170;}
@list l0:level1
{mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level4
{mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level7
{mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Ok, <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">meanwhile this is taking on consideration I took care of ‘\n’, ‘\r’ and “\r\n” to finish the value of a key correctly with a \0.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">All errors have disappeared except one. Almost FINE!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I use now Valgrind (very useful indeed, thanks) but I cannot find something useful that reveals the problem in MacOs Action:
</span><a href="https://github.com/AbelPau/gdal/actions/runs/8271208701/job/22630450124">\r as CR (for unicode) · AbelPau/gdal@1f20e88 (github.com)</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">When I run in a docker with Ubuntu 22.04 with valgrind seem that it’s ok (in other stages there were some useful information):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710==<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== HEAP SUMMARY:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== in use at exit: 29,003 bytes in 256 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== total heap usage: 5,865,320 allocs, 5,865,064 frees, 19,927,117,986 bytes allocated<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710==<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== LEAK SUMMARY:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== definitely lost: 0 bytes in 0 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== indirectly lost: 0 bytes in 0 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== possibly lost: 0 bytes in 0 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== still reachable: 29,003 bytes in 256 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== suppressed: 0 bytes in 0 blocks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== Reachable blocks (those to which a pointer was found) are not shown.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== To see them, rerun with: --leak-check=full --show-leak-kinds=all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710==<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== For lists of detected and suppressed errors, rerun with: -s<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">==21710== ERROR SUMMARY: 26 errors from 3 contexts (suppressed: 0 from 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So, do you have any idea how I could reproduce the macOS_build error?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It’s the only mistake now :=o<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks for any clue!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="ES" style="mso-fareast-language:CA">De:</span></b><span lang="ES" style="mso-fareast-language:CA"> Even Rouault <even.rouault@spatialys.com>
<br>
<b>Enviado el:</b> dimecres, 13 de març de 2024 17:04<br>
<b>Para:</b> Abel Pau <a.pau@creaf.uab.cat>; gdal-dev@lists.osgeo.org<br>
<b>Asunto:</b> Re: [gdal-dev] There's something strange about two tests that are very similar<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>My intuition is that reading/writing ini file should be quite straightforward (unless I'm missing some subtelties of the format). In port/cpl_conv.cpp, we have a CPLLoadConfigOptionsFromFile() function that does that in a specific way for the purposes of
parsing the GDAL configuration file (<a href="https://gdal.org/user/configoptions.html#gdal-configuration-file">https://gdal.org/user/configoptions.html#gdal-configuration-file</a>). But I can imagine we could have a more general std::map<std::string, std::pair<std::string,std::string>>
CPLLoadIniFile(const char* pszIniFilename, CSLConstList papszOptions (if needed)) that would return a map of section -> (key, value) pairs. Regarding an external project, this might be considered but one has to evaluate if there are not downsides (e.g will
the effort to make it compile on all platforms and make all analysis tools we use happy not be greater than its benefits)<span style="font-size:12.0pt;mso-fareast-language:CA"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">Le 13/03/2024 à 15:00, Abel Pau via gdal-dev a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hi again,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">MiraMon files have had INI files containing metadata information for ages.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">To read and write sections and key/values from them, we use specific Windows functions (<a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestring">https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestring</a>).
When I started programming the driver, I had to create a function to do that as I couldn't use the Windows one.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I suspect that these functions are not accurate and are failing.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Is there any function in GDAL that can read INI files (at least to check if a section exists and to get the value of a key in an existing section)? If not, perhaps using the following could be considered:
<a href="https://github.com/brofield/simpleini">https://github.com/brofield/simpleini</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It seems to have an MIT license... If it's possible to use this parser, what would be the procedure? I noticed that Even added a parser for some command line arguments and perhaps something similar
can be done with that.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">If not, is it possible for me to add some files in the MiraMonVector driver and use them?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It's better to use something existing and multiplatform than to "reinvent the wheel" with some new function that can fail (in fact, is failing now).</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:0cm;margin-right:36.0pt;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt">
<span lang="EN-US" style="color:#1F497D"> </span><span style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:CA"><o:p></o:p></span></p>
</blockquote>
</div>
</body>
</html>