This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

'__THROW' after '__attribute__' in posix/unistd.h


>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__));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]