Skip to content

Commit

Permalink
Fixes #95: Now always including limits.h (as we use INT_MAX as a …
Browse files Browse the repository at this point in the history
…default upper bound on buffer sizes, due to the `int` return type of printf()-family functions). Thanks goes to Phillip Johnston <phillip@embeddedartistry.com>.
  • Loading branch information
eyalroz committed Jan 25, 2022
1 parent f4bef6c commit ead6483
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/printf/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,12 @@

#ifdef __cplusplus
#include <cstdint>
#ifdef PRINTF_SUPPORT_MSVC_STYLE_INTEGER_SPECIFIERS
#include <climits>
#endif
extern "C" {
#else
#include <stdbool.h>
#include <stdint.h>
#ifdef PRINTF_SUPPORT_MSVC_STYLE_INTEGER_SPECIFIERS
#include <limits.h>
#endif
#endif // __cplusplus

// Define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H ...) to include the
Expand All @@ -62,10 +58,6 @@ extern "C" {

#include <stdbool.h>
#include <stdint.h>
#ifdef PRINTF_SUPPORT_MSVC_STYLE_INTEGER_SPECIFIERS
#include <limits.h>
#endif


#include <printf/printf.h>

Expand Down

0 comments on commit ead6483

Please sign in to comment.