[sword-devel] Osis2mod debug messages
DM Smith
dmsmith at crosswire.org
Tue Jul 8 22:40:13 EDT 2025
Greg,
Could you try 2 different things and let me know what the result is?
a) include <cstring> as I didn’t include it, but somehow “It works for me”.
b) remove the namespace.
I’ll try the same on the crosswire server.
Thanks,
DM
> On Jul 8, 2025, at 9:35 PM, Greg Hellings <greg.hellings at gmail.com> 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 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.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'; did you mean 'strpbrk'?
> sword> 392 | char* lookahead = 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'; did you mean 'strpbrk'?
> sword> 411 | lookahead = 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'; did you mean 'strpbrk'?
> sword> 434 | bufRead = std::strpbrk(tokenStart, " -");
> 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 PM DM Smith <dmsmith at crosswire.org <mailto:dmsmith at crosswire.org>> wrote:
>> 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=osisID: 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 (": “).
>>
>> In Him,
>> DM
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org <mailto:sword-devel at crosswire.org>
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20250708/f9b11da4/attachment-0001.htm>
More information about the sword-devel
mailing list