Commit: 34f78cb5dbe4010c7b544ab9a5a7cd04233884ef
Parent: eaeb9dec4e7261362a57ff26faf1fa32ec332598
Author: Randy Palamar
Date: Wed, 3 Sep 2025 10:35:20 -0600
build: disable broken gcc error
unused-variable warnings are useful on clang where globals are
ignored but on gcc they are just annoying
Diffstat:
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/build.c b/build.c
@@ -23,16 +23,21 @@ global char *g_argv0;
#define OUTPUT(s) OUTDIR "/" s
#if COMPILER_MSVC
- #define COMMON_FLAGS "-nologo", "-std:c11", "-Fo:" OUTDIR "\\", "-Z7", "-Zo"
- #define DEBUG_FLAGS "-Od", "-D_DEBUG"
- #define OPTIMIZED_FLAGS "-O2"
- #define EXTRA_FLAGS ""
+ #define COMMON_FLAGS "-nologo", "-std:c11", "-Fo:" OUTDIR "\\", "-Z7", "-Zo"
+ #define DEBUG_FLAGS "-Od", "-D_DEBUG"
+ #define OPTIMIZED_FLAGS "-O2"
+ #define EXTRA_FLAGS ""
#else
- #define COMMON_FLAGS "-std=c11", "-pipe", "-Wall"
- #define DEBUG_FLAGS "-O0", "-D_DEBUG", "-Wno-unused-function"
- #define OPTIMIZED_FLAGS "-O3"
- #define EXTRA_FLAGS "-Werror", "-Wextra", "-Wshadow", "-Wconversion", "-Wno-unused-parameter", \
- "-Wno-error=unused-function", "-funsafe-math-optimizations", "-fno-math-errno"
+ #define COMMON_FLAGS "-std=c11", "-pipe", "-Wall"
+ #define DEBUG_FLAGS "-O0", "-D_DEBUG", "-Wno-unused-function"
+ #define OPTIMIZED_FLAGS "-O3"
+ #define EXTRA_FLAGS_BASE "-Werror", "-Wextra", "-Wshadow", "-Wconversion", "-Wno-unused-parameter", \
+ "-Wno-error=unused-function", "-funsafe-math-optimizations", "-fno-math-errno"
+ #if COMPILER_GCC
+ #define EXTRA_FLAGS EXTRA_FLAGS_BASE, "-Wno-unused-variable"
+ #else
+ #define EXTRA_FLAGS EXTRA_FLAGS_BASE
+ #endif
#endif
#define is_aarch64 ARCH_ARM64
diff --git a/static.c b/static.c
@@ -580,9 +580,6 @@ setup_beamformer(Arena *memory, BeamformerCtx **o_ctx, BeamformerInput **o_input
cs->unit_cube_model = render_model_from_arrays(unit_cube_vertices, unit_cube_normals,
sizeof(unit_cube_vertices),
unit_cube_indices, countof(unit_cube_indices));
-
- /* stfu gcc this is used */
- DEBUG_DECL((void)BeamformerParameterBlockRegionOffsets;)
}
function void