Skip to content

Commit 3c30f7a

Browse files
committed
[libc++] Enable -Wmissing-prototypes
1 parent c9719ad commit 3c30f7a

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

libcxx/src/charconv.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
1818

1919
namespace __itoa {
2020

21+
_LIBCPP_DIAGNOSTIC_PUSH
22+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
23+
// These functions exist for ABI compatibility, so we don't ever want a declaration.
2124
_LIBCPP_EXPORTED_FROM_ABI char* __u32toa(uint32_t value, char* buffer) noexcept { return __base_10_u32(buffer, value); }
22-
2325
_LIBCPP_EXPORTED_FROM_ABI char* __u64toa(uint64_t value, char* buffer) noexcept { return __base_10_u64(buffer, value); }
26+
_LIBCPP_DIAGNOSTIC_POP
2427

2528
} // namespace __itoa
2629

libcxx/src/filesystem/int128_builtins.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <__config>
1717
#include <climits>
1818

19+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes") // See the FIXME above
20+
1921
#if _LIBCPP_HAS_INT128
2022

2123
extern "C" __attribute__((no_sanitize("undefined"))) _LIBCPP_EXPORTED_FROM_ABI __int128_t

libcxx/src/include/from_chars_floating_point.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ struct __exponent_result {
193193
// __offset, 0, false. This allows using the results unconditionally, the
194194
// __present is important for the scientific notation, where the value is
195195
// mandatory.
196-
__exponent_result __parse_exponent(const char* __input, size_t __n, size_t __offset, char __marker) {
196+
static __exponent_result __parse_exponent(const char* __input, size_t __n, size_t __offset, char __marker) {
197197
if (__offset + 1 < __n && // an exponent always needs at least one digit.
198198
std::tolower(__input[__offset]) == __marker && //
199199
!std::isspace(__input[__offset + 1]) // leading whitespace is not allowed.
@@ -213,7 +213,7 @@ __exponent_result __parse_exponent(const char* __input, size_t __n, size_t __off
213213
}
214214

215215
// Here we do this operation as int64 to avoid overflow.
216-
int32_t __merge_exponents(int64_t __fractional, int64_t __exponent, int __max_biased_exponent) {
216+
static int32_t __merge_exponents(int64_t __fractional, int64_t __exponent, int __max_biased_exponent) {
217217
int64_t __sum = __fractional + __exponent;
218218

219219
if (__sum > __max_biased_exponent)

libcxx/src/legacy_pointer_safety.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515

1616
_LIBCPP_BEGIN_NAMESPACE_STD
1717

18+
_LIBCPP_DIAGNOSTIC_PUSH
19+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
20+
// These functions exist for ABI compatibility, so we don't ever want a declaration.
1821
_LIBCPP_EXPORTED_FROM_ABI void declare_reachable(void*) {}
1922
_LIBCPP_EXPORTED_FROM_ABI void declare_no_pointers(char*, size_t) {}
2023
_LIBCPP_EXPORTED_FROM_ABI void undeclare_no_pointers(char*, size_t) {}
2124
_LIBCPP_EXPORTED_FROM_ABI void* __undeclare_reachable(void* p) { return p; }
25+
_LIBCPP_DIAGNOSTIC_POP
2226

2327
_LIBCPP_END_NAMESPACE_STD

runtimes/cmake/Modules/WarningFlags.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function(cxx_add_warning_flags target enable_werror enable_pedantic)
2525
-Wformat-nonliteral
2626
-Wzero-length-array
2727
-Wdeprecated-redundant-constexpr-static-def
28+
-Wmissing-prototypes
2829
)
2930

3031
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

0 commit comments

Comments
 (0)