This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.27.9000-32-g26c0717
- From: zack at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 6 Feb 2018 00:59:50 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-32-g26c0717
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 26c07172cde74617ca7214c93cdcfa75321e6b2b (commit)
via de6da571eeff41e69a28744b4c57e219828e26bc (commit)
from c2b84df9b0207d1233b2de07b836a773889d93d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=26c07172cde74617ca7214c93cdcfa75321e6b2b
commit 26c07172cde74617ca7214c93cdcfa75321e6b2b
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Feb 5 14:42:29 2018 -0500
Remove getc and putc macros from the public stdio.h.
The getc and putc macros in the public stdio.h expand to call _IO_getc
and _IO_putc respectively. As _IO_getc, fgetc, and getc are all aliases
for the same function, and _IO_putc, fputc, and putc are also all aliases
for the same function, the macros are pointless. The C standard does
not require getc and putc to be macros, so let's just not have macros.
All four symbols are exported from libc.so at the same, ancient symbol
version, so there should be no risks for binary compatibility. Similarly,
the getchar and putchar inlines in bits/stdio.h forward to getc and putc
instead of their _IO_ aliases.
As a change from longstanding historical practice, this does seem
like it might break _something_, so there is a note in NEWS, which
is also a convenient place to advise people that if they thought getc
and putc had reduced per-character overhead they should consider using
getc_unlocked and putc_unlocked instead. (These are also not macros,
but when optimizing, they are inlines.)
* libio/stdio.h: Don't define getc or putc as macros.
* libio/bits/stdio.h (getchar, putchar): Use getc and putc,
not _IO_getc and _IO_putc.
diff --git a/ChangeLog b/ChangeLog
index ce1ae31..ca221a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2018-02-06 Zack Weinberg <zackw@panix.com>
+ * libio/stdio.h: Don't define getc or putc as macros.
+ * libio/bits/stdio.h (getchar, putchar): Use getc and putc,
+ not _IO_getc and _IO_putc.
+
* stdio-common/tstgetln.c: Don't redefine FILE, va_list, or BUFSIZ.
* stdio-common/tstgetln.c: Don't redefine ssize_t.
diff --git a/NEWS b/NEWS
index 3ac57ec..06ae43d 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,12 @@ Major new features:
Deprecated and removed features, and other changes affecting compatibility:
- [Add deprecations, removals and changes affecting compatibility here]
+ * The stdio.h functions 'getc' and 'putc' are no longer defined as macros.
+ This was never required by the C standard, and the macros just expanded
+ to call alternative names for the same functions. If you hoped getc and
+ putc would provide performance improvements over fgetc and fputc, instead
+ investigate using (f)getc_unlocked and (f)putc_unlocked, and, if
+ necessary, flockfile and funlockfile.
Changes to build and runtime requirements:
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index d287083..eb42b22 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -43,7 +43,7 @@ vprintf (const char *__restrict __fmt, _G_va_list __arg)
__STDIO_INLINE int
getchar (void)
{
- return _IO_getc (stdin);
+ return getc (stdin);
}
@@ -78,7 +78,7 @@ getchar_unlocked (void)
__STDIO_INLINE int
putchar (int __c)
{
- return _IO_putc (__c, stdout);
+ return putc (__c, stdout);
}
diff --git a/libio/stdio.h b/libio/stdio.h
index 95bc902..33de381 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -483,10 +483,6 @@ extern int getc (FILE *__stream);
marked with __THROW. */
extern int getchar (void);
-/* The C standard explicitly says this is a macro, so we always do the
- optimization for it. */
-#define getc(_fp) _IO_getc (_fp)
-
#ifdef __USE_POSIX199506
/* These are defined in POSIX.1:1996.
@@ -523,10 +519,6 @@ extern int putc (int __c, FILE *__stream);
marked with __THROW. */
extern int putchar (int __c);
-/* The C standard explicitly says this can be a macro,
- so we always do the optimization for it. */
-#define putc(_ch, _fp) _IO_putc (_ch, _fp)
-
#ifdef __USE_MISC
/* Faster version when locking is not necessary.
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=de6da571eeff41e69a28744b4c57e219828e26bc
commit de6da571eeff41e69a28744b4c57e219828e26bc
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Feb 5 14:38:46 2018 -0500
Remove some unnecessary redefinitions of std symbols.
Two files in stdio-common were unnecessarily redefining some standard
symbols as their _IO_ aliases.
* stdio-common/vfprintf.c: Don't redefine FILE, va_list, or BUFSIZ.
* stdio-common/tstgetln.c: Don't redefine ssize_t.
diff --git a/ChangeLog b/ChangeLog
index 1a9b7ca..ce1ae31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-06 Zack Weinberg <zackw@panix.com>
+
+ * stdio-common/tstgetln.c: Don't redefine FILE, va_list, or BUFSIZ.
+ * stdio-common/tstgetln.c: Don't redefine ssize_t.
+
2018-02-06 Joseph Myers <joseph@codesourcery.com>
* sysdeps/gnu/netinet/tcp.h (TCP_FASTOPEN_KEY): New macro.
diff --git a/stdio-common/tstgetln.c b/stdio-common/tstgetln.c
index a18f754..6960e68 100644
--- a/stdio-common/tstgetln.c
+++ b/stdio-common/tstgetln.c
@@ -16,8 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
-#undef ssize_t
-#define ssize_t _IO_ssize_t
int
main (int argc, char *argv[])
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 3b87740..a2cab30 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -39,13 +39,8 @@
Beside this it is also shared between the normal and wide character
implementation as defined in ISO/IEC 9899:1990/Amendment 1:1995. */
-
#include <libioP.h>
-#define FILE _IO_FILE
-#undef va_list
-#define va_list _IO_va_list
-#undef BUFSIZ
-#define BUFSIZ _IO_BUFSIZ
+
/* In some cases we need extra space for all the output which is not
counted in the width of the string. We assume 32 characters is
enough. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
NEWS | 7 ++++++-
libio/bits/stdio.h | 4 ++--
libio/stdio.h | 8 --------
stdio-common/tstgetln.c | 2 --
stdio-common/vfprintf.c | 7 +------
6 files changed, 18 insertions(+), 19 deletions(-)
hooks/post-receive
--
GNU C Library master sources