diff --git a/cmd/wuffs-c/release.go b/cmd/wuffs-c/release.go index b68bc5db..4eb0162a 100644 --- a/cmd/wuffs-c/release.go +++ b/cmd/wuffs-c/release.go @@ -170,10 +170,12 @@ const grPragmaPush = ` #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wunreachable-code" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-parameter" +#if defined(__cplusplus) +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif #endif ` diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index b1791a0e..b8945bbe 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -13,10 +13,12 @@ #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wunreachable-code" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-parameter" +#if defined(__cplusplus) +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif #endif // Copyright 2017 The Wuffs Authors.