From 4d6a526c0471713851698187437fe0e4b5d39e45 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Thu, 6 Jun 2024 17:08:12 -0700 Subject: [PATCH] Allow unused parameters in the stdlib build Previously, the stdlib would fail to build if the C toolchain enabled -Werror/-Wextra/-Wunused-parameter since it has unused parameters. This change removes those flags when building the stdlib. --- go/platform/apple.bzl | 1 + go/private/context.bzl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go/platform/apple.bzl b/go/platform/apple.bzl index 45c62d6cd0..6e5e79ec59 100644 --- a/go/platform/apple.bzl +++ b/go/platform/apple.bzl @@ -44,5 +44,6 @@ def apple_ensure_options(ctx, env, _tags, compiler_option_lists, linker_option_l min_version = _apple_version_min(ctx, platform, platform_type) for compiler_options in compiler_option_lists: compiler_options.append(min_version) + compiler_options.append('-Wno-unused-parameter') for linker_options in linker_option_lists: linker_options.append(min_version) diff --git a/go/private/context.bzl b/go/private/context.bzl index 17bc118b0f..eaa2c29e72 100644 --- a/go/private/context.bzl +++ b/go/private/context.bzl @@ -96,6 +96,8 @@ _COMPILER_OPTIONS_DENYLIST = dict({ # fmax-errors limits that and causes build failures. "-fmax-errors=": None, "-Wall": None, + "-Wunused-parameter": None, + "-Wextra": None, # Symbols are needed by Go, so keep them "-g0": None,