Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unused parameters in the stdlib build
Browse files Browse the repository at this point in the history
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.
cramertj committed Aug 22, 2024
1 parent 59235b4 commit 1cec6a5
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/platform/apple.bzl
Original file line number Diff line number Diff line change
@@ -44,5 +44,7 @@ def apple_ensure_options(ctx, env, compiler_option_lists, linker_option_lists, t
min_version = _apple_version_min(ctx, platform, platform_type)
for compiler_options in compiler_option_lists:
compiler_options.append(min_version)
# Allow unused parameters since they are present in the stdlib src.
compiler_options.append("-Wno-unused-parameter")
for linker_options in linker_option_lists:
linker_options.append(min_version)
2 changes: 2 additions & 0 deletions go/private/context.bzl
Original file line number Diff line number Diff line change
@@ -100,6 +100,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,

0 comments on commit 1cec6a5

Please sign in to comment.