Tags: Ykidia/printf
Tags
Updated README.md: * Reflecting `FetchContent` compatibility * Other changes to the usage section * Emphasized how aliasing standard library functions must be followed by the appropriate preprocessor definition on use (regards eyalroz#67).
Changes since v5.0.0: **Repository structure and other general changes:** * eyalroz#58 : Moved `printf.h` and `printf.c` into the `src/` directory **Build configuration:** * eyalroz#59: Unified names of CMake variable and C preprocessor define for the integer-to-string buffer size. It's now `PRINTF_INTEGER_BUFFER_SIZE` everywhere. * eyalroz#54: Changed the mechanism for aliasing the standard `printf()` family functions. **Library API changes:** * eyalroz#55: Using `putchar_()` instead of `_putchar()`. **Code formatting, naming, comments etc.:** * eyalroz#54: Avoiding the ifdef-if preprocessor directive idiom, in favor of ifndef-define-endif-if. * Change include guard name - avoiding heading underscore. **Other issues:** * Dropped Travis CI metadata file. * README.md documentation update * More pedantic use of `NULL` in the test suite. * Fixed: Was not passing `TEST_WITH_NON_STANDARD_FORMAT_STRINGS` properly to the test suite. * Added a test for aliasing the standard library's `printf()`: `aliasing.cpp` * Change include guard name - avoiding heading underscore. * eyalroz#52: Test suite no longer checks for "10e+2", "10e+5" etc. but rather "1e+3", "1e+6" etc. * Disabling a format warning about another invalid format. **Caveats:** * Still no special handling for denormals.
Version 5.0.0 This is the first version following the fork from Macro Paland's [repository](https://github.com/mpaland/printf): Repository structure and other general changes: * mpaland#106: The repository is now built using CMake (minimum CMake version 3.13) rather than a Makefile which needs manual editing for different platforms * Library users have verified builds on Windows + MSVC, Windows + Cygwin + GCC, and various Linux distributions * The library may be built either statically or dynamically * An additional test program - a autotest/fuzzer, has been added (Michael Clift) * Not using coverity and codecov like Macro Paland's repository was. Build configuration: * eyalroz#19: The threshold for transition from decimal to exponential floating-point representation is now specified using a number of decimal digits rather than a float value. * preprocessor define names have changed, hopefully becoming somewhat clearer semantically; see `README.md` for details. * eyalroz#18: The preprocessor defines can now alternatively be taken from a `printf_config.h`, which may be more convenient when building within other, larger, projects. When building with CMake, this file will be generated based on CMake option choices. * eyalroz#14: Can now choose whether or not to have the standard library function names (printf, sprintf etc) alias this library's function names. * eyalroz#17: We now check the values of preprocessor defines rather than whether they're defined or not, even for boolean settings (with a default value fallback for the undefined case) * eyalroz#20: The catch2 testing framework header has been updated to v2.13.6 ub.com/mpaland/printf): * mpaland#45: Incorrect comment regarding the return value of `snprintf_` and `vsnprintf_` * Dropped the assumption of `char` being signed (Erik Hallberg) * Additional bug fixes which have been obviated by later changes to the code. Other issues fixed after the fork from [mpaland/printf](https://github.com/mpaland/printf): * Avoiding careless use of unsized integer types for values requiring larger sizes. * Formatting of `"%p"` now uses a `0x` prefix, matching glibc (Eli Lipsitz) * Formatting of `"%p"` now uses `(nil)` for NULL pointers, matching glibc (Eli Lipsitz) * Avoided numerous warnings from different compilers in stricter warning modes (especially GCC, clang, MSVC), both in the library itself and * Added numerous additional checks to the test suite; it currently has 484 checks. * eyalroz#49, eyalroz#38 : Test suite checks involving disabled features should now all be guarded by `#if`-`#else` to only be used when support for these features is enabled * mpaland#63: Explicitly checking pointer values against NULL, just in case, somehow, its value is not 0. * The test suite now uses `CHECK()` rather than `REQUIRE()`, so if anything fails you see all the failures. * mpaland#99, mpaland#113 : Corrected issues with properly respecting precision when padding is applied. * mpaland#75: Corrected standard-non-compliant expected string in some test suite checks. * mpaland#99, mpaland#109, mpaland#110, mpaland#114: Corrected some issues involving the interplay of the hash modifier (`#`), hexadecimal and octal representations, and trailing and leading zero printing. * mpaland#115 : Unified the two functions formatting long and long long values into just one (now named `print_integer`) * mpaland#116 : More properly representing numeric bases in the code. * mpaland#54: Corrected zero and negative zers one are not listed. Library API changes: * Added `vfctprintf_()`, a `va_list`-based variant of `fctprintf()` (fivdi; Damian Pala; Jonathan Lenz) * Added `vsprintf_()`, the `va_list`-based variant of `sprintf()` (Alexander Olenyev) * mpaland#79: Marked the various functions with ` __attribute__((format))` for compilers supporting it (Sam van Kampen; Josh Klodnicki). * eyalroz#14: No longer forcing the aliasing the standard library function names nor polluting the global set of macros with those names. Code formatting, naming comments etc.: * Now using less shorthand names in the code, for hopefully better readability (e.g. `prec` -> `precision`, `pow10` -> `powers_of_10`) * Redone doxygen comments in the header file. * Consistent spacing: 2-space indentation, no tabs * mpaland#104: Now using linefeed-only line breaks in all files (i.e. rather than DOS-style CRLF). Other issues fixed before the fork from [mpaland/printf](https://githo formatting in exponential format. * eyalroz#26 : Improved floating point accuracy * Partially merged the functions for printing in decimal and exponential formats * mpaland#120 : Fixed a situation where rounding was making us print "10" as the integral part in an exponential representation. * mpaland#122, eyalroz#28, mpaland#124 : Fixed cases of incorrect choice between exponential and decimal with `g` specifier. * eyalroz#37: Now supporting the possibility of the `double` type having 32 bits (single-precision) rather than 64 bits (double precision). * eyalroz#46: Consistent, properly-documented `"%zi"` behavior with build-time checks **Caveats:** * mpaland#119 : The library is missing special handling for denormals, to determine their true exponent. It only handles the special-case of 0 (or -0), while other denormals are assumed to have the exponent in their exponent bits. * Issues which were introduced, then resolved, after the last version and before this one are not listed.
PreviousNext