aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2017-10-31 13:50:02 +0100
committerMarco Paland <marco@paland.com>2017-10-31 13:50:02 +0100
commitc25e65ff3e49d0e139e0a8fcbeb4014167407219 (patch)
treef32fa0d2b1bea0f549557a2d4c09d395cee82145 /README.md
parent569de268ca835dcb3ed816e797956bba975cb5b8 (diff)
parent5813e52e3f08ca1c4bb4e4ea41e03ce787ac25c8 (diff)
downloadprintf-c25e65ff3e49d0e139e0a8fcbeb4014167407219.tar.gz
printf-c25e65ff3e49d0e139e0a8fcbeb4014167407219.tar.bz2
printf-c25e65ff3e49d0e139e0a8fcbeb4014167407219.zip
Merge branch 'travis'
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 17 insertions, 9 deletions
diff --git a/README.md b/README.md
index 8ec250f..f2e230f 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,34 @@
# printf / sprintf for embedded systems
-This is a tiny but fully loaded printf, sprintf and snprintf implementation.
+[![Build Status](https://travis-ci.org/mpaland/printf.svg?branch=master)](https://travis-ci.org/mpaland/printf)
+[![Coveralls Status](https://coveralls.io/repos/github/mpaland/printf/badge.svg?branch=master)](https://coveralls.io/github/mpaland/printf?branch=master)
+[![Coverity Status](https://img.shields.io/coverity/scan/14180.svg)](https://scan.coverity.com/projects/mpaland-printf)
+[![Github Issues](https://img.shields.io/github/issues/mpaland/printf.svg)](http://github.com/mpaland/printf/issues)
+[![Github Releases](https://img.shields.io/github/release/mpaland/printf.svg)](https://github.com/mpaland/printf/releases)
+[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/mpaland/avl_array/master/LICENSE)
+
+This is a tiny but **fully loaded** printf, sprintf and snprintf implementation.
Primarily designed for usage in embedded systems, where printf is not available due to memory issues or in avoidance of linking against libc.
-Using the standard libc printf may pull a lot of unwanted library stuff and can bloat code size about 20k. In this case the following implementation can be used.
-Absolutely **NO dependencies** are required, printf.cpp brings all necessary routines, even its own fast ftoa conversion.
+Using the standard libc printf may pull **a lot** of unwanted library stuff and can bloat code size about 20k. In this case the following implementation can be used.
+Absolutely **NO dependencies** are required, printf.cpp brings all necessary routines, even its own fast `ftoa` conversion.
If memory footprint is really a critical issue, floating point support can be turned off via the `PRINTF_FLOAT_SUPPORT` compiler switch.
When using printf (instead of sprintf) you have to provide your own `_putchar()` low level function as console output.
-## Design goals
+## Highligths and design goals
There is a boatload of so called 'tiny' printf implementations around. So why this one?
-I tested many implementations, but most of them have very limited flag/specifier support, a lot of other dependencies or are just not standard compliant and failing the test suite.
+I've tested many implementations, but most of them have very limited flag/specifier support, a lot of other dependencies or are just not standard compliant and failing the test suite.
Therefore I decided to write an own implementation which meets the following items:
- Very small implementation (< 500 code lines)
- NO dependencies, no libs, just one module file
- Support of all important flags, width and precision sub-specifiers (see below)
- - Support of float number representation (with an own fast ftoa)
+ - Support of dec/float number representation (with an own fast itoa/ftoa)
- Reentrant and thread-safe, malloc free
- - LINT and compiler L4 warning free, clean code
- - Extensive test suite passing
+ - LINT and compiler L4 warning free, coverity clean, automotive ready
+ - Extensive test suite (> 260 test cases) passing
- MIT license
@@ -34,7 +41,8 @@ Usage is 1:1 like the according stdio.h library version:
`int sprintf(char* buffer, const char* format, ...);`
`int snprintf(char* buffer, size_t count, const char* format, ...);`
-**Due to genaral security reasons it is highly recommended to use snprintf (with the max buffer size as `count` parameter) only.**
+**Due to genaral security reasons it is highly recommended to use `snprintf` (with the max buffer size as `count` parameter) only.**
+`sprintf` has no buffer limitation, so when necessary - use it with care!
## Format specifiers