| Summary: | [tcf][patch] MinGW/MSVC fixes for crash in TCF reference agent | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] TCF | Reporter: | Ed Swartz <ed.swartz> | ||||
| Component: | Core | Assignee: | Project Inbox <dsdp.tm.tcf-inbox> | ||||
| Status: | VERIFIED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | cdtdoug, eugene, ken.ryall | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 0.3 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
On my Windows XP machine "%lld" works fine with both MinGW and MSVC. You probably have some older version of MSVC runtime DLL. Googling "%lld" shows it was not supported on Windows before VC++ 2005. Anyway, I'm going to change the code to use ISO standard macros like PRId64. Fixed: change the code to use standard printf format macros like PRId64. Thanks Comment on attachment 171359 [details]
update to replace %ll* with macros
Thanks Eugene for putting in the iplog-, this helps understanding that the patch was not used although the issue is resolved.
Thanks! Comment on attachment 171359 [details]
update to replace %ll* with macros
Marking patch obsolete since it was not used.
Moving bugs to new home for IP log. Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3 |
Created attachment 171359 [details] update to replace %ll* with macros Due to some trace() logging for peers with invalid timestamps (discovery_udp.c:udp_receive_ack_slaves), we are seeing nearly immediate crashes of TCF agents built with MinGW. (Apparently in our office we have a ton of dead TCF agents still kicking about. ;) In MinGW and MSVC, the interpretation in printf of "%lld" and "%llX" is "%u" and "%x" (for legacy compatibility, pre-C99). So formatting this value (actually, any "%s" values after it) causes crashes in vfprintf(). This patch, thusly, replaces uses of "%lld" and "%llX" with macros that adapt to the build environment. Note: I only tested this build on MinGW. It would be good if someone tested it on MSVC to double-check. I did verify it doesn't break the Cygwin build. And please feel free to rename the macros... they are a bit wordy.