[libc] Add noexcept to aligned_alloc declaration in full-build mode (#191236)

The extern "C" declaration of aligned_alloc in the proxy header lacked a
noexcept specifier, producing warnings when compiled as C++. Added a
__cplusplus guard so C++ gets noexcept while C compilation remains
unaffected.
This commit is contained in:
Jeff Bailey
2026-04-30 17:58:54 +01:00
committed by GitHub
parent 7072b13351
commit 2b0fde2809
4 changed files with 19 additions and 4 deletions

View File

@@ -10,8 +10,13 @@
#define LLVM_LIBC_HDR_FUNC_ALIGNED_ALLOC_H
#ifdef LIBC_FULL_BUILD
#include "hdr/types/size_t.h"
extern "C" void *aligned_alloc(size_t, size_t);
#include "include/__llvm-libc-common.h"
__BEGIN_C_DECLS
void *aligned_alloc(size_t, size_t) __NOEXCEPT;
__END_C_DECLS
#else // Overlay mode

View File

@@ -11,7 +11,11 @@
#ifdef LIBC_FULL_BUILD
extern "C" void free(void *) noexcept;
#include "include/__llvm-libc-common.h"
__BEGIN_C_DECLS
void free(void *) __NOEXCEPT;
__END_C_DECLS
#else // Overlay mode

View File

@@ -12,8 +12,11 @@
#ifdef LIBC_FULL_BUILD
#include "hdr/types/size_t.h"
#include "include/__llvm-libc-common.h"
extern "C" void *malloc(size_t) noexcept;
__BEGIN_C_DECLS
void *malloc(size_t) __NOEXCEPT;
__END_C_DECLS
#else // Overlay mode

View File

@@ -12,8 +12,11 @@
#ifdef LIBC_FULL_BUILD
#include "hdr/types/size_t.h"
#include "include/__llvm-libc-common.h"
extern "C" void *realloc(void *ptr, size_t new_size) noexcept;
__BEGIN_C_DECLS
void *realloc(void *ptr, size_t new_size) __NOEXCEPT;
__END_C_DECLS
#else // Overlay mode