diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
| commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
| tree | b5877475619e4c938e98757d518bb1e9cbead751 /stdio-common | |
| parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
| download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz glibc-a334319f6530564d22e775935d9c91663623a1b4.zip | |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'stdio-common')
52 files changed, 265 insertions, 1835 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 7bd368bdca..3a66f1d021 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1991-2002, 2003, 2004 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 @@ -21,7 +21,7 @@ # subdir := stdio-common -headers := stdio_ext.h printf.h bits/printf-ldbl.h +headers := printf.h stdio_ext.h routines := \ ctermid cuserid \ @@ -33,14 +33,14 @@ routines := \ perror psignal \ tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \ getline getw putw \ - remove rename renameat \ + remove rename \ flockfile ftrylockfile funlockfile install-others = $(inst_includedir)/bits/stdio_lim.h include ../Makeconfig -aux := errlist siglist printf-parsemb printf-parsewc fxprintf +aux := errlist siglist printf-parsemb printf-parsewc distribute := _itoa.h _itowa.h _i18n_number.h \ printf-parse.h stdio_lim.h.in tst-unbputc.sh tst-printf.sh @@ -53,8 +53,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \ tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \ tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \ - tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ - tst-fwrite bug16 bug17 tst-sprintf2 + tst-popen tst-unlockedio test-srcs = tst-unbputc tst-printf diff --git a/stdio-common/Versions b/stdio-common/Versions index 2f64429346..1dbce1a124 100644 --- a/stdio-common/Versions +++ b/stdio-common/Versions @@ -37,7 +37,7 @@ libc { tempnam; tmpfile; tmpnam; tmpnam_r; # v* - vfprintf; vfscanf; vprintf; + vfprintf; vfscanf; vprintf; } GLIBC_2.1 { # p* @@ -46,9 +46,6 @@ libc { # t* tmpfile; tmpfile64; } - GLIBC_2.4 { - renameat; - } GLIBC_PRIVATE { # global variables _itoa_lower_digits; diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index 285fde2ab9..f61b23fceb 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -1,5 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2007 + Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Torbjorn Granlund <tege@matematik.su.se> @@ -269,7 +269,6 @@ _itoa (value, buflim, base, upper_case) default: { - char *bufend = buflim; #if BITS_PER_MP_LIMB == 64 mp_limb_t base_multiplier = brec->base_multiplier; if (brec->flag) @@ -455,8 +454,6 @@ _itoa (value, buflim, base, upper_case) } while (n != 0); #endif - if (buflim == bufend) - *--buflim = '0'; } break; } diff --git a/stdio-common/asprintf.c b/stdio-common/asprintf.c index 66e766ebfb..2c466d28d5 100644 --- a/stdio-common/asprintf.c +++ b/stdio-common/asprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 2004, 2006 +/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,7 +20,7 @@ #include <stdarg.h> #include <stdio.h> -#include <libioP.h> +#include <libio/libioP.h> #define vasprintf(s, f, a) _IO_vasprintf (s, f, a) #undef __asprintf @@ -28,7 +28,7 @@ allocated with malloc and stored in *STRING_PTR. */ /* VARARGS2 */ int -___asprintf (char **string_ptr, const char *format, ...) +__asprintf (char **string_ptr, const char *format, ...) { va_list arg; int done; @@ -39,7 +39,5 @@ ___asprintf (char **string_ptr, const char *format, ...) return done; } -INTDEF2(___asprintf, __asprintf) - -ldbl_strong_alias (___asprintf, __asprintf) -ldbl_weak_alias (___asprintf, asprintf) +INTDEF(__asprintf) +weak_alias (__asprintf, asprintf) diff --git a/stdio-common/bits/printf-ldbl.h b/stdio-common/bits/printf-ldbl.h deleted file mode 100644 index cbdc3f1cbc..0000000000 --- a/stdio-common/bits/printf-ldbl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -mlong-double-64 compatibility mode for <printf.h> functions. - Copyright (C) 2006 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _PRINTF_H -# error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead." -#endif - -__LDBL_REDIR_DECL (printf_size) diff --git a/stdio-common/bug16.c b/stdio-common/bug16.c deleted file mode 100644 index 84269f3b6d..0000000000 --- a/stdio-common/bug16.c +++ /dev/null @@ -1,43 +0,0 @@ -#include <stdio.h> -#include <string.h> - -struct -{ - long double val; - const char str[4][7]; -} tests[] = -{ - { 0x0.FFFFp+0L, { "0X1P+0", "0X2P-1", "0X4P-2", "0X8P-3" } }, - { 0x0.FFFFp+1L, { "0X1P+1", "0X2P+0", "0X4P-1", "0X8P-2" } }, - { 0x0.FFFFp+2L, { "0X1P+2", "0X2P+1", "0X4P+0", "0X8P-1" } }, - { 0x0.FFFFp+3L, { "0X1P+3", "0X2P+2", "0X4P+1", "0X8P+0" } } -}; - -static int -do_test (void) -{ - char buf[100]; - int ret = 0; - - for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) - { - snprintf (buf, sizeof (buf), "%.0LA", tests[i].val); - - size_t j; - for (j = 0; j < 4; ++j) - if (strcmp (buf, tests[i].str[j]) == 0) - break; - - if (j == 4) - { - printf ("%zd: got \"%s\", expected \"%s\" or equivalent\n", - i, buf, tests[i].str[0]); - ret = 1; - } - } - - return ret; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/stdio-common/bug17.c b/stdio-common/bug17.c deleted file mode 100644 index 2ef398674b..0000000000 --- a/stdio-common/bug17.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <stdio.h> -#include <string.h> - -static int -do_test (void) -{ - static const char expect[] = "0, 0, 0"; - char buf[100]; - int status = 0; - - static const char fmt1[] = "%0d, %0ld, %0lld"; - snprintf (buf, sizeof (buf), fmt1, 0, 0L, 0LL); - if (strcmp (buf, expect) != 0) - { - printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt1, buf, expect); - status = 1; - } - - static const char fmt2[] = "%0u, %0lu, %0llu"; - snprintf (buf, sizeof (buf), fmt2, 0u, 0uL, 0uLL); - if (strcmp (buf, expect) != 0) - { - printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt2, buf, expect); - status = 1; - } - - return status; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/stdio-common/ctermid.c b/stdio-common/ctermid.c deleted file mode 100644 index e4d94eada2..0000000000 --- a/stdio-common/ctermid.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <stdio.h> - - -/* Return the name of the controlling terminal. - If S is not NULL, the name is copied into it (it should be at - least L_ctermid bytes long), otherwise a static buffer is used. */ -char * -ctermid (s) - char *s; -{ - __set_errno (ENOSYS); - return NULL; -} - - -stub_warning (ctermid) -#include <stub-tag.h> diff --git a/stdio-common/cuserid.c b/stdio-common/cuserid.c deleted file mode 100644 index 826972f4de..0000000000 --- a/stdio-common/cuserid.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <stdio.h> -#include <errno.h> - -/* Return the username of the caller. - If S is not NULL, it points to a buffer of at least L_cuserid bytes - into which the name is copied; otherwise, a static buffer is used. */ -char * -cuserid (s) - char *s; -{ - __set_errno (ENOSYS); |
