stdio.h vs. bits/stdio.h header brokeness?
Thorsten Kukuk
kukuk@suse.de
Fri May 9 11:14:00 GMT 2003
On Thu, May 08, Franz Sirl wrote:
> Hi,
>
> with current glibc CVS and gcc-3.3pre I get a lot of g++ testsuite warnings
> when I run the g++ testsuite with -O2 on powerpc-linux.
> The reason is that various functions (eg. vprintf, getchar,
> getc_unlocked,...) from stdio.h differ in their exception specifications
> between stdio.h and bits/stdio.h, in bits/stdio.h they are declared with
> __THROW, in stdio.h declared without __THROW.
>
> Which one is the correct declaration?
According to the ChangeLog, the one in bits/stdio.h must be wrong.
I append a patch to fix this.
Thorsten
--
Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de
SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg
--------------------------------------------------------------------
Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B
-------------- next part --------------
2003-05-09 Thorsten Kukuk <kukuk@suse.de>
* libio/bits/stdio.h: Sync prototypes with libio/stdio.h
(remove __THROW from possible cancellation points).
--- libio/bits/stdio.h 2 Aug 2001 16:09:51 -0000 1.8
+++ libio/bits/stdio.h 9 May 2003 11:10:08 -0000
@@ -31,14 +31,14 @@
#ifdef __USE_EXTERN_INLINES
/* Write formatted output to stdout from argument list ARG. */
__STDIO_INLINE int
-vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW
+vprintf (__const char *__restrict __fmt, _G_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
/* Read a character from stdin. */
__STDIO_INLINE int
-getchar (void) __THROW
+getchar (void)
{
return _IO_getc (stdin);
}
@@ -47,14 +47,14 @@
# if defined __USE_POSIX || defined __USE_MISC
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
-getc_unlocked (FILE *__fp) __THROW
+getc_unlocked (FILE *__fp)
{
return _IO_getc_unlocked (__fp);
}
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
-getchar_unlocked (void) __THROW
+getchar_unlocked (void)
{
return _IO_getc_unlocked (stdin);
}
@@ -63,7 +63,7 @@
/* Write a character to stdout. */
__STDIO_INLINE int
-putchar (int __c) __THROW
+putchar (int __c)
{
return _IO_putc (__c, stdout);
}
@@ -72,7 +72,7 @@
# ifdef __USE_MISC
/* Faster version when locking is not necessary. */
__STDIO_INLINE int
-fputc_unlocked (int __c, FILE *__stream) __THROW
+fputc_unlocked (int __c, FILE *__stream)
{
return _IO_putc_unlocked (__c, __stream);
}
@@ -82,14 +82,14 @@
# if defined __USE_POSIX || defined __USE_MISC
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
-putc_unlocked (int __c, FILE *__stream) __THROW
+putc_unlocked (int __c, FILE *__stream)
{
return _IO_putc_unlocked (__c, __stream);
}
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
-putchar_unlocked (int __c) __THROW
+putchar_unlocked (int __c)
{
return _IO_putc_unlocked (__c, stdout);
}
@@ -99,7 +99,7 @@
# ifdef __USE_GNU
/* Like `getdelim', but reads up to a newline. */
__STDIO_INLINE _IO_ssize_t
-getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
+getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
}
More information about the Libc-alpha
mailing list