add more overflow handling for printf builtin; start incorporating C23 stdckdint ; rework PRIdMAX replacements

This commit is contained in:
Chet Ramey
2024-03-15 12:55:39 -04:00
parent bf944fe91f
commit 167a9248f9
22 changed files with 608 additions and 91 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
/* bashtypes.h -- Bash system types. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2009,2024 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -35,6 +35,18 @@
# include <inttypes.h>
#endif
/* Fix PRIdMAX on systems where it's broken. */
#ifdef PRI_MACROS_BROKEN
# undef PRIdMAX
#endif
#ifndef PRIdMAX
# if HAVE_LONG_LONG
# define PRIdMAX "lld"
# else
# define PRIdMAX "ld"
# endif
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif