Skip to content

Commit ec7a883

Browse files
committed
build: suppress array-bounds errors in libxkbcommon
These occur when building with GCC 12.1. It might be the case that these would be suppressed by updating the package, but that would also require installing new build tools (meson), as well as potentially more dependencies (wayland). ```bash In function 'ExprCreateBoolean', inlined from 'BoolVarCreate' at src/xkbcomp/ast-build.c:316:19: src/xkbcomp/ast-build.c:119:23: error: array subscript 'ExprDef[0]' is partly outside array bounds of 'unsigned char[32]' [-Werror=array-bounds] 119 | expr->boolean.set = set; | ~~~~~~~~~~~~~~~~~~^~~~~ In function 'ExprCreate', inlined from 'ExprCreateBoolean' at src/xkbcomp/ast-build.c:118:5, inlined from 'BoolVarCreate' at src/xkbcomp/ast-build.c:316:19: src/xkbcomp/ast-build.c:75:21: note: object of size 32 allocated by 'malloc' 75 | ExprDef *expr = malloc(size); | ^~~~~~~~~~~~ ``` Github-Pull: #25436 Rebased-From: 1bdbbbd
1 parent 0567787 commit ec7a883

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

depends/packages/libxkbcommon.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ $(package)_file_name=$(package)-$($(package)_version).tar.xz
55
$(package)_sha256_hash=60ddcff932b7fd352752d51a5c4f04f3d0403230a584df9a2e0d5ed87c486c8b
66
$(package)_dependencies=libxcb
77

8+
# This package explicitly enables -Werror=array-bounds, which causes build failures
9+
# with GCC 12.1+. Work around that by turning errors back into warnings.
10+
# This workaround would be dropped if the package was updated, as that would require
11+
# a different build system (Meson)
812
define $(package)_set_vars
913
$(package)_config_opts = --enable-option-checking --disable-dependency-tracking
1014
$(package)_config_opts += --disable-static --disable-docs
15+
$(package)_cflags += -Wno-error=array-bounds
1116
endef
1217

1318
define $(package)_preprocess_cmds

0 commit comments

Comments
 (0)