'__THROW' after '__attribute__' in posix/unistd.h
sean.chen@turbolinux.com
sean.chen@turbolinux.com
Wed Mar 1 23:27:00 GMT 2000
>Submitter-Id: net
>Originator: Sean Chen
>Organization: TurboLinux, Inc.
>Confidential: no
>Synopsis: '__THROW' after '__attribute__' in posix/unistd.h
>Severity: critical
>Priority: high
>Category: libc
>Class: sw-bug
>Release: libc-2.1.90
>Environment:
Host type: i686-pc-linux-gnu
System: Linux cat.tlc.com.cn 2.3.48 #1 Mon Feb 28 17:38:33 CST 2000 i686 unknown
Architecture: i686
Addons: crypt linuxthreads soft-fp
Build CC: gcc
Compiler version: 2.95.2 19991024 (release)
Kernel headers: 2.3.48
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio
>Description:
In line 817 and 818 of posix/unistd.h (installed as /usr/include/unistd.h),
'__THROW' are put behind '__attribute__ ((__const__))', causing
'parse error' when C++ routines are compiled.
>How-To-Repeat:
Write test.cc with just one line:
#include <unistd.h>
and compile it:
# g++ -c -D_GNU_SOURCE test.cc
/usr/include/unistd.h:817: parse error before `throw'
/usr/include/unistd.h:818: parse error before `throw'
>Fix:
Edit posix/unistd.h, modify line 817 and 818 from
extern int __getpagesize (void) __attribute__ ((__const__)) __THROW;
extern int getpagesize (void) __attribute__ ((__const__)) __THROW;
to
extern int __getpagesize (void) __THROW __attribute__ ((__const__));
extern int getpagesize (void) __THROW __attribute__ ((__const__));
More information about the Libc-alpha
mailing list