Re: Osis2mod debug messages

Greg Hellings <[email protected]> Tue, 8 Jul 2025 22:42:25 -0500
Newsgroups gmane.comp.literature.sword.devel
Message-ID <CAHxvOV+WcCDxSg+X1tMW7FY-M2te6Jq5SLTdRVMPb7mJbP5-aQ@mail.gmail.com>
--===============4104826752570864129==
Content-Type: multipart/alternative; boundary="00000000000030afe0063976defd"

--00000000000030afe0063976defd
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Including it also fixes the build in my cross-build environment. Did you
indicate you were initially building with MSVC? That might explain the
difference.

--Greg

On Tue, Jul 8, 2025 at 9:54=E2=80=AFPM DM Smith <[email protected]> wro=
te:

> While I don=E2=80=99t get the error in my local build environment, I get =
it on the
> crosswire server. If I include <cstring>, it compiles just fine.
> I=E2=80=99ll guess that my build environment includes it indirectly.
>
> DM
>
> On Jul 8, 2025, at 10:40=E2=80=AFPM, DM Smith <[email protected]> wro=
te:
>
> Greg,
> Could you try 2 different things and let me know what the result is?
> a) include <cstring> as I didn=E2=80=99t include it, but somehow =E2=80=
=9CIt works for me=E2=80=9D.
> b) remove the namespace.
>
> I=E2=80=99ll try the same on the crosswire server.
>
> Thanks,
> DM
>
> On Jul 8, 2025, at 9:35=E2=80=AFPM, Greg Hellings <[email protected]=
m> wrote:
>
> DM,
>
> As mentioned elsewhere, here is the compile error from gcc when trying to
> cross-build osis2mod. It appears to be a case where the function exists b=
ut
> is not namespaced to `std::` in whichever version of C++ is the
> default version. From a quick glance around it appears there is a
> difference between <string.h>, which defines the function for C and
> <cstring> which defines the function for C++ within the `std` namespace.
>
> --Greg
>
> sword> osis2mod.cpp:371:19: error: 'strpbrk' is not a member of 'std'; di=
d
> you mean 'strpbrk'?
> sword>   371 |         if (!std::strpbrk(bufStart, "! :")) {
> sword>       |                   ^~~~~~~
> sword> In file included from
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/io.h:
> 10,
> sword>                  from
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/fcntl
> .h:8,
> sword>                  from osis2mod.cpp:29:
> sword>
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/string.h:92:31:
> note: 'strp
> brk' declared here
> sword>    92 |   _CONST_RETURN char *__cdecl strpbrk(const char
> *_Str,const char *_Control);
> sword>       |                               ^~~~~~~
> sword> osis2mod.cpp:392:40: error: 'strpbrk' is not a member of 'std'; di=
d
> you mean 'strpbrk'?
> sword>   392 |                 char* lookahead =3D std::strpbrk(bufRead, =
":
> -");
> sword>       |                                        ^~~~~~~
> sword>
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/string.h:92:31:
> note: 'strp
> brk' declared here
> sword>    92 |   _CONST_RETURN char *__cdecl strpbrk(const char
> *_Str,const char *_Control);
> sword>       |                               ^~~~~~~
> sword> osis2mod.cpp:411:34: error: 'strpbrk' is not a member of 'std'; di=
d
> you mean 'strpbrk'?
> sword>   411 |                 lookahead =3D std::strpbrk(bufRead, "! -")=
;
> sword>       |                                  ^~~~~~~
> sword>
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/string.h:92:31:
> note: 'strp
> brk' declared here
> sword>    92 |   _CONST_RETURN char *__cdecl strpbrk(const char
> *_Str,const char *_Control);
> sword> osis2mod.cpp:434:40: error: 'strpbrk' is not a member of 'std'; di=
d
> you mean 'strpbrk'?
> sword>   434 |                         bufRead =3D std::strpbrk(tokenStar=
t,
> " -");
> sword>       |                                        ^~~~~~~
> sword>
> /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1=
.20250322/x86_64-w64-mingw32/sys-include/string.h:92:31:
> note: 'strp
> brk' declared here
> sword>    92 |   _CONST_RETURN char *__cdecl strpbrk(const char
> *_Str,const char *_Control);
> sword>       |                               ^~~~~~~
>
>
> On Mon, Jul 7, 2025 at 4:14=E2=80=AFPM DM Smith <[email protected]> w=
rote:
>
>> I have just committed revision 3907 for osis2mod, adding location
>> information to messages so that one can more readily tie reported events=
 to
>> the OSIS input file.
>>
>> I have updated the osis2mod wiki entry to document it more fully:
>> https://wiki.crosswire.org/Osis2mod#Messages
>>
>> MODTOOLS-25 give location in input for messages.
>>
>> Created identifyMsg which creates a standardized message for reporting
>> and used it for all messages to standard out.
>>
>> The message is of the form:
>>  type(kind)[linePos,charPos] osisID=3DosisID: message
>>
>> Where:
>>  type           The message type (e.g., "ERROR", "WARNING", "INFO").
>>  kind           The message category or kind (e.g., "REF", "PARSE").
>>  linePos        The position in the file of the last line that was read.
>>  charPos        The position in the line of the last character that was
>> read.
>>  osisID         (Optional) The current OSIS ID to include. May be nullpt=
r
>> or empty.
>>  message        event description with details
>>
>> * If linePos is 0, the position ([linePos,charPos]) is omitted.
>> * If osisID is nullptr or empty, the osisID part is omitted.
>> * The returned string always ends with a colon and a trailing space (":
>> =E2=80=9C).
>>
>> In Him,
>> DM
>>
>> _______________________________________________
>> sword-devel mailing list: [email protected]
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
> _______________________________________________
> sword-devel mailing list: [email protected]
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
>
>
> _______________________________________________
> sword-devel mailing list: [email protected]
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>

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

<div dir=3D"ltr"><div>Including it also fixes the build in my cross-build e=
nvironment. Did you indicate you were initially building with MSVC? That mi=
ght explain the difference.</div><div><br></div><div>--Greg</div></div><br>=
<div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"=
gmail_attr">On Tue, Jul 8, 2025 at 9:54=E2=80=AFPM DM Smith &lt;<a href=3D"=
mailto:[email protected]">[email protected]</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex"><div>While I don=E2=80=
=99t get the error in my local build environment, I get it on the crosswire=
 server. If I include &lt;cstring&gt;, it compiles just fine.<div>I=E2=80=
=99ll guess that my build environment includes it indirectly.<br><div><br><=
/div><div>DM<br id=3D"m_-4153283895800732367lineBreakAtBeginningOfMessage">=
<div><br><blockquote type=3D"cite"><div>On Jul 8, 2025, at 10:40=E2=80=AFPM=
, DM Smith &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">d=
[email protected]</a>&gt; wrote:</div><br><div><div>Greg,<div>Could you =
try 2 different things and let me know what the result is?<div>a) include &=
lt;cstring&gt; as I didn=E2=80=99t include it, but somehow =E2=80=9CIt work=
s for me=E2=80=9D.</div><div>b) remove the namespace.</div><div><br></div><=
div>I=E2=80=99ll try the same on the crosswire server.</div><div><br></div>=
<div>Thanks,</div><div><span style=3D"white-space:pre-wrap">	</span>DM<br i=
d=3D"m_-4153283895800732367lineBreakAtBeginningOfMessage"><div><br><blockqu=
ote type=3D"cite"><div>On Jul 8, 2025, at 9:35=E2=80=AFPM, Greg Hellings &l=
t;<a href=3D"mailto:[email protected]" target=3D"_blank">greg.helling=
[email protected]</a>&gt; wrote:</div><br><div><div dir=3D"ltr"><div>DM,</div><di=
v><br></div><div>As mentioned elsewhere, here is the compile error from gcc=
 when trying to cross-build osis2mod. It appears to be a case where the fun=
ction exists but is not namespaced to `std::` in whichever version of C++ i=
s the default=C2=A0version. From a quick glance around it appears there is =
a difference between &lt;string.h&gt;, which defines the function for C and=
 &lt;cstring&gt; which defines the function for C++ within the `std` namesp=
ace.</div><div><br></div><div>--Greg</div><div><br></div><div>sword&gt; osi=
s2mod.cpp:371:19: error: &#39;strpbrk&#39; is not a member of &#39;std&#39;=
; did you mean &#39;strpbrk&#39;?<br>sword&gt; =C2=A0 371 | =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 if (!std::strpbrk(bufStart, &quot;! :&quot;)) {<br>sword&gt; =
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ^~~~~~~<br>sword&gt; In file included from /nix/store/np3pb3a6wd=
1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-mi=
ngw32/sys-include/io.h:<br>10,<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0from /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzr=
cilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-mingw32/sys-include/=
fcntl<br>.h:8,<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0from osis2mod.cpp:29:<br>sword&gt; /nix/store/np3pb3a6wd1b=
f55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-ming=
w32/sys-include/string.h:92:31: note: &#39;strp<br>brk&#39; declared here<b=
r>sword&gt; =C2=A0 =C2=A092 | =C2=A0 _CONST_RETURN char *__cdecl strpbrk(co=
nst char *_Str,const char *_Control);<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 | =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~<br>sword&gt; osis2mod.cpp:392:40: e=
rror: &#39;strpbrk&#39; is not a member of &#39;std&#39;; did you mean &#39=
;strpbrk&#39;?<br>sword&gt; =C2=A0 392 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 char* lookahead =3D std::strpbrk(bufRead, &quot;: -&q=
uot;);<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~<br>sword&gt; /nix/store/np3pb3a6w=
d1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-m=
ingw32/sys-include/string.h:92:31: note: &#39;strp<br>brk&#39; declared her=
e<br>sword&gt; =C2=A0 =C2=A092 | =C2=A0 _CONST_RETURN char *__cdecl strpbrk=
(const char *_Str,const char *_Control);<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 =
| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~<br>sword&gt; osis2mod.cpp:411:34: e=
rror: &#39;strpbrk&#39; is not a member of &#39;std&#39;; did you mean &#39=
;strpbrk&#39;?<br>sword&gt; =C2=A0 411 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 lookahead =3D std::strpbrk(bufRead, &quot;! -&quot;);=
<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0^~~~~~~<br>sword&gt; /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_=
64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-mingw32/sys-include/string.h:=
92:31: note: &#39;strp<br>brk&#39; declared here<br>sword&gt; =C2=A0 =C2=A0=
92 | =C2=A0 _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char=
 *_Control);<br>sword&gt; osis2mod.cpp:434:40: error: &#39;strpbrk&#39; is =
not a member of &#39;std&#39;; did you mean &#39;strpbrk&#39;?<br>sword&gt;=
 =C2=A0 434 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 bufRead =3D std::strpbrk(tokenStart, &quot; -&quot=
;);<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~<br>sword&gt; /nix/store/np3pb3a6wd1b=
f55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_64-w64-ming=
w32/sys-include/string.h:92:31: note: &#39;strp<br>brk&#39; declared here<b=
r>sword&gt; =C2=A0 =C2=A092 | =C2=A0 _CONST_RETURN char *__cdecl strpbrk(co=
nst char *_Str,const char *_Control);<br>sword&gt; =C2=A0 =C2=A0 =C2=A0 | =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~<br><br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 7, 2025 =
at 4:14=E2=80=AFPM DM Smith &lt;<a href=3D"mailto:[email protected]" ta=
rget=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex"><div>I have just committed revision 39=
07 for osis2mod, adding location information to messages so that one can mo=
re readily tie reported events to the OSIS input file.<div><br></div><div>I=
 have updated the osis2mod wiki entry to document it more fully:=C2=A0<a hr=
ef=3D"https://wiki.crosswire.org/Osis2mod#Messages" target=3D"_blank">https=
://wiki.crosswire.org/Osis2mod#Messages</a><br><div><br><div>MODTOOLS-25 gi=
ve location in input for messages.<br><br>Created identifyMsg which creates=
 a standardized message for reporting<br>and used it for all messages to st=
andard out.<br><br>The message is of the form:<br>=C2=A0type(kind)[linePos,=
charPos] osisID=3DosisID: message<br><br>Where:<br>=C2=A0type =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0The message type (e.g., &qu=
ot;ERROR&quot;, &quot;WARNING&quot;, &quot;INFO&quot;).<br>=C2=A0kind =C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0The message catego=
ry or kind (e.g., &quot;REF&quot;, &quot;PARSE&quot;).<br>=C2=A0linePos =C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0The position in the file of the last=
 line that was read.<br>=C2=A0charPos =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0The position in the line of the last character that was read.<br>=C2=
=A0osisID =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(Optional) The cu=
rrent OSIS ID to include. May be nullptr or empty.<br>=C2=A0message =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0event description with details<br><br>*=
 If linePos is 0, the position ([linePos,charPos]) is omitted.<br>* If osis=
ID is nullptr or empty, the osisID part is omitted.<br>* The returned strin=
g always ends with a colon and a trailing space (&quot;: =E2=80=9C).</div><=
div><br></div><div>In Him,</div><div><span style=3D"white-space:pre-wrap">	=
</span>DM<br><br></div></div></div></div>__________________________________=
_____________<br>
sword-devel mailing list: <a href=3D"mailto:[email protected]" targ=
et=3D"_blank">[email protected]</a><br>
<a href=3D"http://crosswire.org/mailman/listinfo/sword-devel" rel=3D"norefe=
rrer" target=3D"_blank">http://crosswire.org/mailman/listinfo/sword-devel</=
a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>
_______________________________________________<br>sword-devel mailing list=
: <a href=3D"mailto:[email protected]" target=3D"_blank">sword-deve=
[email protected]</a><br><a href=3D"http://crosswire.org/mailman/listinfo/swo=
rd-devel" target=3D"_blank">http://crosswire.org/mailman/listinfo/sword-dev=
el</a><br>Instructions to unsubscribe/change your settings at above page<br=
></div></blockquote></div><br></div></div></div></div></blockquote></div><b=
r></div></div></div>_______________________________________________<br>
sword-devel mailing list: <a href=3D"mailto:[email protected]" targ=
et=3D"_blank">[email protected]</a><br>
<a href=3D"http://crosswire.org/mailman/listinfo/sword-devel" rel=3D"norefe=
rrer" target=3D"_blank">http://crosswire.org/mailman/listinfo/sword-devel</=
a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>

--00000000000030afe0063976defd--

--===============4104826752570864129==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
sword-devel mailing list: [email protected]
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

--===============4104826752570864129==--