about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS7
-rw-r--r--libio/bits/stdio.h4
-rw-r--r--libio/stdio.h8
4 files changed, 12 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index ce1ae31944..ca221a4ebe 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 3ac57eca4e..06ae43d3f0 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 d287083de1..eb42b22153 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 95bc902a82..33de3813bb 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.