From 09d892c55aa25e0165fce796c6c390900b9f04c6 Mon Sep 17 00:00:00 2001 From: Samuel Bronson Date: Wed, 6 May 2026 14:08:55 -0400 Subject: [PATCH] Remove duplicate diagnostic pragmas Clang has been unconditionally accepting the GCC diagnostic pragmas since before the clang pragmas were introduced in [r71572][1]. This means we don't need to duplicate the pragmas for clang-cl's benefit. [1]: https://github.com/llvm/llvm-project/commit/b61448d4902f28d286e0b2fcb5ff72aea1b3404b --- cmd/wuffs-c/release.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/cmd/wuffs-c/release.go b/cmd/wuffs-c/release.go index 6ea1bd60..3e425429 100644 --- a/cmd/wuffs-c/release.go +++ b/cmd/wuffs-c/release.go @@ -174,9 +174,9 @@ const grPragmaPush = ` // Wuffs' C code is generated automatically, not hand-written. These warnings' // costs outweigh the benefits. // -// The "elif defined(__clang__)" isn't redundant. While vanilla clang defines +// The "|| defined(__clang__)" isn't redundant. While vanilla clang defines // __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not. -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" @@ -186,16 +186,6 @@ const grPragmaPush = ` #if defined(__cplusplus) #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -#elif defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#pragma clang diagnostic ignored "-Wmissing-field-initializers" -#pragma clang diagnostic ignored "-Wunreachable-code" -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wunused-parameter" -#if defined(__cplusplus) -#pragma clang diagnostic ignored "-Wold-style-cast" -#endif #endif `