about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabrielftg@linux.ibm.com>2019-07-11 11:47:47 -0300
committerGabriel F. T. Gomes <gabrielftg@linux.ibm.com>2019-11-27 15:52:41 -0300
commit590ef889bc7afe42d4feec94e1c4fbd4ddd65226 (patch)
tree73fa4b5f39f63a91c8232df0789b36716fffc075 /sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c
parentff3cb5accb80471df69fac2c0dded9cab794220a (diff)
downloadglibc-590ef889bc7afe42d4feec94e1c4fbd4ddd65226.tar.gz
glibc-590ef889bc7afe42d4feec94e1c4fbd4ddd65226.tar.xz
glibc-590ef889bc7afe42d4feec94e1c4fbd4ddd65226.zip
ldbl-128ibm-compat: Add obstack printing functions
Similarly to the functions from the *printf family, this patch adds
implementations for __obstack_*printf* functions that set the
'mode_flags' parameter to PRINTF_LDBL_USES_FLOAT128, before making calls
to __vfprintf_internal (indirectly through __obstack_vprintf_internal).

Tested for powerpc64le.

Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c
new file mode 100644
index 0000000000..6d85da8958
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vobstack_chk.c
@@ -0,0 +1,31 @@
+/* Wrapper for __obstack_vprintf_chk.  IEEE128 version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libio/libioP.h>
+
+extern int
+___ieee128__obstack_vprintf_chk  (struct obstack *obstack, int flag,
+				  const char *format, va_list ap)
+{
+  unsigned int mode = PRINTF_LDBL_USES_FLOAT128;
+  if (flag > 0)
+    mode |= PRINTF_FORTIFY;
+
+  return __obstack_vprintf_internal (obstack, format, ap, mode);
+}
+strong_alias (___ieee128__obstack_vprintf_chk, __obstack_vprintf_chkieee128)