This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Rest of trivial decorations


On Sat, Apr 18, 2009 at 16:47, Jan Hubicka <hubicka@ucw.cz> wrote:
>
> OK, thanks for pointer! ÂDoes this seem fine?
> Honza
>
> [...]
>
> +#ifndef _GLIBCXX_NOTHROW
> +# ifdef __cplusplus
> +# Âdefine _GLIBCXX_NOTHROW throw()
> +# else
> +# Âdefine _GLIBCXX_NOTHROW __attribute__((nothrow))
> +# endif
> +#endif
> +
>

By my reading, those two definitions have different meanings
(http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Function-Attributes.html),
since throw() can lead to terminate, whereas the latter is presumably
UB if an exception is thrown.

Since these are cases that certainly don't throw, is there a reason to
not just use __attribute__((nothrow)) always?  That ought to solve any
issue with spurious try/catch additions, too...

~ Scott


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