mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +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
@@ -279,28 +279,3 @@ wuffs_base__io_writer__set_mark(wuffs_base__io_writer* o, uint8_t* mark) {
|
||||
|
||||
#define wuffs_base__utility__null_io_reader wuffs_base__null_io_reader
|
||||
#define wuffs_base__utility__null_io_writer wuffs_base__null_io_writer
|
||||
|
||||
// ---------------- Bureaucracy re -Wunused-function
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__io_private()
|
||||
WUFFS_BASE__POTENTIALLY_UNUSED;
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__io_private() {
|
||||
(void)(wuffs_base__io_buffer__is_valid);
|
||||
(void)(wuffs_base__io_reader__is_eof);
|
||||
(void)(wuffs_base__io_reader__is_valid);
|
||||
(void)(wuffs_base__io_reader__set);
|
||||
(void)(wuffs_base__io_reader__set_limit);
|
||||
(void)(wuffs_base__io_reader__set_mark);
|
||||
(void)(wuffs_base__io_reader__take);
|
||||
(void)(wuffs_base__io_writer__copy_from_slice);
|
||||
(void)(wuffs_base__io_writer__copy_n_from_history);
|
||||
(void)(wuffs_base__io_writer__copy_n_from_history_fast);
|
||||
(void)(wuffs_base__io_writer__copy_n_from_reader);
|
||||
(void)(wuffs_base__io_writer__copy_n_from_slice);
|
||||
(void)(wuffs_base__io_writer__is_valid);
|
||||
(void)(wuffs_base__io_writer__set);
|
||||
(void)(wuffs_base__io_writer__set_mark);
|
||||
}
|
||||
Reference in new issue
Block a user