Re: Osis2mod debug messages
Greg Hellings <[email protected]> Tue, 8 Jul 2025 20:35:14 -0500
| Newsgroups | gmane.comp.literature.sword.devel |
|---|---|
| Message-ID | <CAHxvOV+fKv7q_Y+R5dopSHne5pNuncx4MNX-K4m_C9NDD12rxw@mail.gmail.com> |
--===============2601624987815475159==
Content-Type: multipart/alternative; boundary="000000000000645115063975174f"
--000000000000645115063975174f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 but
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'; did
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.2=
0250322/x86_64-w64-mingw32/sys-include/io.h:
10,
sword> from
/nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.2=
0250322/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.2=
0250322/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'; did
you mean 'strpbrk'?
sword> 392 | char* lookahead =3D std::strpbrk(bufRead, ":
-");
sword> | ^~~~~~~
sword>
/nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.2=
0250322/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'; did
you mean 'strpbrk'?
sword> 411 | lookahead =3D std::strpbrk(bufRead, "! -");
sword> | ^~~~~~~
sword>
/nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.2=
0250322/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'; did
you mean 'strpbrk'?
sword> 434 | bufRead =3D std::strpbrk(tokenStart,=
"
-");
sword> | ^~~~~~~
sword>
/nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.2=
0250322/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]> wro=
te:
> 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 nullptr
> 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
>
--000000000000645115063975174f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>DM,</div><div><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 function exists but is not namespaced to `st=
d::` in whichever version of C++ is the default=C2=A0version. From a quick =
glance around it appears there is a difference between <string.h>, wh=
ich defines the function for C and <cstring> which defines the functi=
on for C++ within the `std` namespace.</div><div><br></div><div>--Greg</div=
><div><br></div><div>sword> osis2mod.cpp:371:19: error: 'strpbrk'=
; is not a member of 'std'; did you mean 'strpbrk'?<br>swor=
d> =C2=A0 371 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!std::strpbrk(bufStart, =
"! :")) {<br>sword> =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> In file =
included from /nix/store/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw3=
2-gcc-14.2.1.20250322/x86_64-w64-mingw32/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/np3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250=
322/x86_64-w64-mingw32/sys-include/fcntl<br>.h:8,<br>sword> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0from osis2mod.cpp:29:<b=
r>sword> /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' declared here<br>sword> =C2=A0 =C2=A092 | =C2=A0 _CO=
NST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);<br=
>sword> =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> osis2mod.cpp:392:40: error: 'strpbrk' is not a member of =
'std'; did you mean 'strpbrk'?<br>sword> =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, ": -");<br>sword> =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^~~~~~~<b=
r>sword> /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' declared here<br>sword> =C2=A0 =C2=A092 | =C2=A0 _CO=
NST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);<br=
>sword> =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> osis2mod.cpp:411:34: error: 'strpbrk' is not a member of =
'std'; did you mean 'strpbrk'?<br>sword> =C2=A0 411 | =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lookahead =3D std::=
strpbrk(bufRead, "! -");<br>sword> =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> /nix/store/np=
3pb3a6wd1bf55hp0rl3i64mfzrcilm-x86_64-w64-mingw32-gcc-14.2.1.20250322/x86_6=
4-w64-mingw32/sys-include/string.h:92:31: note: 'strp<br>brk' decla=
red here<br>sword> =C2=A0 =C2=A092 | =C2=A0 _CONST_RETURN char *__cdecl =
strpbrk(const char *_Str,const char *_Control);<br>sword> osis2mod.cpp:4=
34:40: error: 'strpbrk' is not a member of 'std'; did you m=
ean 'strpbrk'?<br>sword> =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, " -");<br>sword> =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^~~~~~~<b=
r>sword> /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' declared here<br>sword> =C2=A0 =C2=A092 | =C2=A0 _CO=
NST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);<br=
>sword> =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 gmail_quote_container"><div d=
ir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 7, 2025 at 4:14=E2=80=AFPM DM S=
mith <<a href=3D"mailto:[email protected]">[email protected]</a>=
> 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=
>I have just committed revision 3907 for osis2mod, adding location informat=
ion to messages so that one can more readily tie reported events to the OSI=
S input file.<div><br></div><div>I have updated the osis2mod wiki entry to =
document it more fully:=C2=A0<a href=3D"https://wiki.crosswire.org/Osis2mod=
#Messages" target=3D"_blank">https://wiki.crosswire.org/Osis2mod#Messages</=
a><br><div><br><div>MODTOOLS-25 give location in input for messages.<br><br=
>Created identifyMsg which creates a standardized message for reporting<br>=
and used it for all messages to standard 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., "ERROR", "WARNING", "=
;INFO").<br>=C2=A0kind =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0The message category or kind (e.g., "REF", "P=
ARSE").<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 current 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 de=
scription with details<br><br>* If linePos is 0, the position ([linePos,cha=
rPos]) is omitted.<br>* If osisID is nullptr or empty, the osisID part is o=
mitted.<br>* The returned string always ends with a colon and a trailing sp=
ace (": =E2=80=9C).</div><div><br></div><div>In Him,</div><div><span s=
tyle=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>
--000000000000645115063975174f--
--===============2601624987815475159==
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
--===============2601624987815475159==--