On Tue, Jan 29, 2019 at 12:02:23AM +0100, Gustaf Neumann wrote:

> In case, the name is for unknown reason not initialized, the change [1]
> should help.
> https://bitbucket.org/naviserver/naviserver/commits/a1a07e7f1397e71809c74ca3a4bf93649affd8b2

That didn't make any difference.

> The function Ns_ThreadId() returns uintptr_t, which is printed with 
> format-code PRIxPTR, maybe here is something
> wrong. There is some indication [2], that the C99 prefix "ll" does not 
> work in all versions of MSC.
> https://stackoverflow.com/questions/18107426/printf-format-for-unsigned-int64-on-windows

Ah ha, thanks!  I'm building NaviServer 32-bit on Windows.  The
garbled output was due to using that "PRIxPTR" macro to format the
ThreadId.  If I replace that format specifier with a either plain "%u"
or "%I32u", then everything works fine!

Hm, Ns_ThreadId() returns type uintptr_t, so why does LogToDString()
use PRIxPTR in the first place?  Shouldn't it use PRIuPTR, with a "u"
for unsigned?  I think so, so I switched to that.

Here's the fix I'm using now:

  
https://bitbucket.org/apiskors/naviserver/commits/16e6658319ae9595e7d874e68086e482f2f74f85
  Fix garbled log output on Windows, PRIuPTR now gives I64u or I32u there.

And here's a pull request that includes that, plus a couple other
(very minor) fixes:

  
https://bitbucket.org/naviserver/naviserver/pull-requests/20/fix-garbled-log-output-on-windows/diff

-- 
Andrew Piskorski <a...@piskorski.com>


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to