From ff21acc4ed0991e4038864f80b695ee8a4d3e7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 15 Apr 2026 02:00:25 +0200 Subject: [PATCH 1/4] libunwind: disable all warnings --- src/libs/libunwind.zig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/libs/libunwind.zig b/src/libs/libunwind.zig index c1437d39bd0c800039b4231f2ae7c172749676ff..37b1243a7802a33052abdcbc2206c58ac5a62b0d 100644 --- a/src/libs/libunwind.zig +++ b/src/libs/libunwind.zig @@ -104,6 +104,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr .assembly_with_cpp => {}, else => unreachable, // See `unwind_src_list`. } + try cflags.append("-w"); // Disable all warnings. try cflags.append("-I"); try cflags.append(try comp.dirs.zig_lib.join(arena, &.{ "libunwind", "include" })); try cflags.append("-D_LIBUNWIND_HIDE_SYMBOLS"); @@ -126,13 +127,6 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr if (target.cpu.arch.isArm() and target.abi.float() == .hard) { try cflags.append("-DCOMPILER_RT_ARMHF_TARGET"); } - try cflags.append("-Wno-bitwise-conditional-parentheses"); - try cflags.append("-Wno-visibility"); - try cflags.append("-Wno-incompatible-pointer-types"); - - if (target.os.tag == .windows) { - try cflags.append("-Wno-dll-attribute-on-redeclaration"); - } c_source_files[i] = .{ .src_path = try comp.dirs.zig_lib.join(arena, &.{unwind_src}), -- 2.54.0 From 9115aee6d75970310e512dc1789373533eb33ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 15 Apr 2026 02:02:37 +0200 Subject: [PATCH 2/4] glibc: disable all warnings --- src/libs/glibc.zig | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/libs/glibc.zig b/src/libs/glibc.zig index 92a629fa823744dc81dc78b2c4727f65e4f5bbe7..8db6ebde264e33ef512c4923c416a3cccc7000e7 100644 --- a/src/libs/glibc.zig +++ b/src/libs/glibc.zig @@ -189,11 +189,11 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre var args = std.array_list.Managed([]const u8).init(arena); try add_include_dirs(comp, arena, &args); try args.appendSlice(&[_][]const u8{ + "-w", // Disable all warnings. "-D_LIBC_REENTRANT", "-include", try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), "-DMODULE_NAME=libc", - "-Wno-nonportable-include-path", "-include", try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), "-DPIC", @@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre }); try add_include_dirs(comp, arena, &args); try args.appendSlice(&[_][]const u8{ + "-w", // Disable all warnings. "-D_LIBC_REENTRANT", "-DMODULE_NAME=libc", "-DTOP_NAMESPACE=glibc", @@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre .owner = undefined, }; }; - const init_o: Compilation.CSourceFile = .{ - .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"), - .owner = undefined, + const init_o: Compilation.CSourceFile = blk: { + var args = std.array_list.Managed([]const u8).init(arena); + try args.appendSlice(&[_][]const u8{ + "-w", // Disable all warnings. + }); + break :blk .{ + .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"), + .cache_exempt_flags = args.items, + .owner = undefined, + }; }; var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o }; const basename = if (comp.config.output_mode == .Exe and !comp.config.pie) "crt1" else "Scrt1"; @@ -308,15 +316,14 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre var args = std.array_list.Managed([]const u8).init(arena); try args.appendSlice(&[_][]const u8{ + "-w", // Disable all warnings. "-std=gnu11", "-fgnu89-inline", "-fmerge-all-constants", "-frounding-math", - "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math. "-fno-common", "-fmath-errno", "-ftls-model=initial-exec", - "-Wno-ignored-attributes", "-Qunused-arguments", }); try add_include_dirs(comp, arena, &args); @@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre "-include", try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), "-DMODULE_NAME=libc", - "-Wno-nonportable-include-path", "-include", try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), "-DPIC", -- 2.54.0 From 575e21c61a9257c5b0134f85c1bf849fb168c78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 15 Apr 2026 02:02:51 +0200 Subject: [PATCH 3/4] mingw: disable all warnings --- src/libs/mingw.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig index acad93b970d894e87baa872e4d27e2d978c6e583..85fc522385b20722409be62ce7688d7b6b27588d 100644 --- a/src/libs/mingw.zig +++ b/src/libs/mingw.zig @@ -135,8 +135,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre try addCcArgs(comp, arena, &winpthreads_args); try winpthreads_args.appendSlice(&[_][]const u8{ "-DIN_WINPTHREAD", - // winpthreads incorrectly assumes that Clang has `-Wprio-ctor-dtor`. - "-Wno-unknown-warning-option", }); switch (comp.compilerRtOptMode()) { @@ -170,6 +168,7 @@ fn addCcArgs( args: *std.array_list.Managed([]const u8), ) error{OutOfMemory}!void { try args.appendSlice(&[_][]const u8{ + "-w", // Disable all warnings. "-std=gnu11", "-D__USE_MINGW_ANSI_STDIO=0", -- 2.54.0 From 18964c086589a1aa3dfbd7ae8ace294bb1379c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 15 Apr 2026 02:04:17 +0200 Subject: [PATCH 4/4] libcxx: disable all warnings --- src/libs/libcxx.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libs/libcxx.zig b/src/libs/libcxx.zig index 316ac6d815b3d6023f0d63164194e412cfdd7e5c..07b56997f533308f44a2e7839026d24acf8d3fef 100644 --- a/src/libs/libcxx.zig +++ b/src/libs/libcxx.zig @@ -206,6 +206,7 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError! try addCxxArgs(comp, arena, &cflags); + try cflags.append("-w"); // Disable all warnings. try cflags.append("-DNDEBUG"); try cflags.append("-DLIBC_NAMESPACE=__llvm_libc_common_utils"); try cflags.append("-D_LIBCPP_BUILDING_LIBRARY"); @@ -223,9 +224,6 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError! try cflags.append("-nostdinc++"); try cflags.append("-std=c++23"); - try cflags.append("-Wno-user-defined-literals"); - try cflags.append("-Wno-covered-switch-default"); - try cflags.append("-Wno-suggest-override"); // These depend on only the zig lib directory file path, which is // purposefully either in the cache or not in the cache. The decision @@ -401,6 +399,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr try addCxxArgs(comp, arena, &cflags); + try cflags.append("-w"); // Disable all warnings. try cflags.append("-DNDEBUG"); try cflags.append("-D_LIBCPP_BUILDING_LIBRARY"); try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY"); @@ -422,9 +421,6 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr try cflags.append("-nostdinc++"); try cflags.append("-fstrict-aliasing"); try cflags.append("-std=c++23"); - try cflags.append("-Wno-user-defined-literals"); - try cflags.append("-Wno-covered-switch-default"); - try cflags.append("-Wno-suggest-override"); // These depend on only the zig lib directory file path, which is // purposefully either in the cache or not in the cache. The decision -- 2.54.0