diff options
-rw-r--r-- | doc/overview_code.c | 14 | ||||
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | src/path.c | 2 | ||||
-rw-r--r-- | src/posix/filesystem_posix.c | 4 | ||||
-rw-r--r-- | src/posix/sem_posix.c | 3 | ||||
-rw-r--r-- | src/win32/win32_util.h | 4 | ||||
-rw-r--r-- | test/cpp/.clang-tidy | 3 |
7 files changed, 17 insertions, 14 deletions
diff --git a/doc/overview_code.c b/doc/overview_code.c index 6835d9a..063f829 100644 --- a/doc/overview_code.c +++ b/doc/overview_code.c @@ -1,4 +1,4 @@ -// Copyright 2021-2023 David Robillard <d@drobilla.net> +// Copyright 2021-2024 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC /* @@ -11,11 +11,6 @@ #include <zix/attributes.h> #include <zix/string_view.h> -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-variable" -#endif - static void string_views(void) { @@ -24,6 +19,7 @@ string_views(void) // begin make-empty-string ZixStringView empty = zix_empty_string(); // end make-empty-string + (void)empty; // begin make-static-string static const ZixStringView hello = ZIX_STATIC_STRING("hello"); @@ -33,10 +29,12 @@ string_views(void) // begin measure-string ZixStringView view = zix_string(string_pointer); // end measure-string + (void)view; // begin make-string-view ZixStringView slice = zix_substring(string_pointer, 4); // end make-string-view + (void)slice; } ZIX_CONST_FUNC int @@ -45,7 +43,3 @@ main(void) string_views(); return 0; } - -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif diff --git a/meson.build b/meson.build index 96a6d27..d6792f7 100644 --- a/meson.build +++ b/meson.build @@ -48,6 +48,7 @@ if cc.get_id() in ['clang', 'emscripten'] if host_machine.system() == 'windows' c_suppressions += [ + '-Wno-bad-function-cast', '-Wno-deprecated-declarations', '-Wno-nonportable-system-include-path', ] @@ -1,4 +1,4 @@ -// Copyright 2007-2022 David Robillard <d@drobilla.net> +// Copyright 2007-2024 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC #include <zix/path.h> diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c index bb398c1..ea091e0 100644 --- a/src/posix/filesystem_posix.c +++ b/src/posix/filesystem_posix.c @@ -341,6 +341,9 @@ zix_canonical_path(ZixAllocator* const allocator, const char* const path) } zix_free(allocator, buffer); + +#else + (void)allocator; #endif return NULL; @@ -449,6 +452,7 @@ zix_current_path(ZixAllocator* const allocator) return current; #else + (void)allocator; return NULL; #endif diff --git a/src/posix/sem_posix.c b/src/posix/sem_posix.c index ea49db9..5b14e37 100644 --- a/src/posix/sem_posix.c +++ b/src/posix/sem_posix.c @@ -61,6 +61,9 @@ zix_sem_timed_wait(ZixSem* sem, { #if !USE_CLOCK_GETTIME || !USE_SEM_TIMEDWAIT + (void)sem; + (void)seconds; + (void)nanoseconds; return ZIX_STATUS_NOT_SUPPORTED; #else diff --git a/src/win32/win32_util.h b/src/win32/win32_util.h index 3123ef4..3ae2e2b 100644 --- a/src/win32/win32_util.h +++ b/src/win32/win32_util.h @@ -14,11 +14,11 @@ typedef const char ArgPathChar; /// Copy and convert a path argument if necessary ArgPathChar* -arg_path_new(ZixAllocator* const allocator, const char* const path); +arg_path_new(ZixAllocator* allocator, const char* path); /// Free a path from arg_path_new() if necessary void -arg_path_free(ZixAllocator* const allocator, ArgPathChar* const path); +arg_path_free(ZixAllocator* allocator, ArgPathChar* path); /// Convert from (user) UTF-8 to (Windows) UTF-16 wchar_t* diff --git a/test/cpp/.clang-tidy b/test/cpp/.clang-tidy index 9a3cd8c..b8c3032 100644 --- a/test/cpp/.clang-tidy +++ b/test/cpp/.clang-tidy @@ -1,10 +1,11 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> +# Copyright 2020-2024 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC Checks: > -*-avoid-c-arrays, -*-no-malloc, -android-cloexec-fopen, + -bugprone-exception-escape, -cppcoreguidelines-owning-memory, -fuchsia-default-arguments-calls, -modernize-raw-string-literal, |