[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#377416: libc6-dev: __THROW defined in <sys/cdefs.h> is broken with GCC 3.3



Roger Leigh wrote:
Package: libc6-dev
Version: 2.3.6-15
Severity: important

# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
#  define __THROW       __attribute__ ((__nothrow__))          XXXX
#  define __NTH(fct)    __attribute__ ((__nothrow__)) fct
# else
#  if defined __cplusplus && __GNUC_PREREQ (2,8)
#   define __THROW      throw ()
#   define __NTH(fct)   fct throw ()
#  else
#   define __THROW
#   define __NTH(fct)   fct
#  endif
# endif

The line marked with XXXX expands incorrectly:

void f() __THROW
==> void f() __attribute__ ((__nothrow__))

instead of void __attribute__ ((__nothrow__)) f()

The __NTH macro is OK.  It's OK for later compilers, but I'm not sure
this special case for GCC 3.3 is necessary, unless there's a reason
why the more general throw() doesn't work with GCC 3.3?  throw() is
standard C++ syntax, so this looks rather broken, IMO.

Except we are compiling C code here, not C++ code.

--
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: