[CDRIVER-1368] libbson fprintf PRI specifiers for visual studio 2013 Created: 11/Jul/16 Updated: 24/Dec/16 Resolved: 24/Dec/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libbson |
| Affects Version/s: | 1.3.5 |
| Fix Version/s: | 1.6.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Almansour Belleh Blanco [X] | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 64bit |
||
| Description |
|
Character string literals for the fprintf() and fwprintf() family of functions (PRIxxx) are declared differently in bson-compat.h and in inttypes.h. bson-compat.h
inttypes.h #define _PFX_8 "hh" #define PRIi32 _PFX_32 "i" |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 24/Dec/16 ] |
|
I believe this works as designed. MSVC supports format specifiers like "%I64i" since its early versions, whereas the specifiers like "%lld" are preferred for GCC and Clang. The msinttypes project, which has the same goal as our bson-compat.h for MSVC, also uses "%I64i" and similar macros, not "%lld". And finally, if you search for "PRId64" on this Wikipedia page: https://en.wikipedia.org/wiki/Printf_format_string ... it says that "PRId64" is typically equivalent to I64d on Windows, although there is no reference cited. Almansour is there a specific issue that our specifiers are causing? What unintended behavior do you observe? |
| Comment by A. Jesse Jiryu Davis [ 11/Jul/16 ] |
|
Thanks for the report! |