mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Rework how we avoid clang's -Wunused-function
The previous technique to avoid this was to have explicit (void)(wuffs_foo__bar_baz); no-op lines of code. However, on MSVC, this triggers warning C4551 "function call missing argument list". https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4551 says that "A function call must include the open and close parentheses". But this is not a function call, it is casting the function pointer. This false positive is a bug in MSVC, but we work around it for Wuffs.
This commit is contained in:
1 parent
0e3d691048
commit
ed52fdecb9
11 files changed
+51
-594
No files matched your search
@@ -72,17 +72,3 @@ wuffs_base__malloc_slice_u64(void* (*malloc_func)(size_t), uint64_t num_u64) {
|
||||
}
|
||||
return wuffs_base__make_slice_u64(NULL, 0);
|
||||
}
|
||||
|
||||
// ---------------- Bureaucracy re -Wunused-function
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__memory_public()
|
||||
WUFFS_BASE__POTENTIALLY_UNUSED;
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__memory_public() {
|
||||
(void)(wuffs_base__malloc_slice_u16);
|
||||
(void)(wuffs_base__malloc_slice_u32);
|
||||
(void)(wuffs_base__malloc_slice_u64);
|
||||
(void)(wuffs_base__malloc_slice_u8);
|
||||
}
|
||||
Reference in new issue
Block a user