llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.58k stars 11.81k forks source link

[libc] mark internal definitions as nothrow #112427

Open nickdesaulniers opened 4 days ago

nickdesaulniers commented 4 days ago

Forked from https://github.com/llvm/llvm-project/pull/112415.

Most of our internal declarations (example: headers under libc/src/) do not have the gnu::nothrow function attribute on the declarations or definitions. We should probably add them.

https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Function-Attributes.html

most functions in the standard C library can be guaranteed not to throw an exception with the notable exceptions of qsort and bsearch that take function pointer arguments.

llvmbot commented 4 days ago

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Forked from https://github.com/llvm/llvm-project/pull/112415. Most of our internal declarations (example: headers under libc/src/) do not have the `gnu::nothrow` function attribute on the declarations or definitions. We should probably add them. https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Function-Attributes.html > most functions in the standard C library can be guaranteed not to throw an exception with the notable exceptions of qsort and bsearch that take function pointer arguments.