Skip to content

Compilation fails with glibc 2.43 #506

@dschepler

Description

@dschepler

In a build of selinux version 3.10 on my system where I recently upgraded to glibc 2.43, I get:

cc  -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wbuiltin-macro-redefined -Wattributes -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Woverflow -Wpointer-to-int-cast -Wpragmas -Wframe-larger-than=32768 -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -Werror -Wno-aggregate-return -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wstrict-overflow=5 -fno-semantic-interposition -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 -DHAVE_STRLCPY -DHAVE_REALLOCARRAY  -c -o selinux_config.o selinux_config.c
selinux_config.c: In function ‘selinux_set_policy_root’:
selinux_config.c:284:29: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  284 |         char *policy_type = strrchr(path, '/');
      |                             ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:181: selinux_config.o] Error 1
make[2]: Leaving directory '/home/unfrobbed-dev/pkgs/libselinux/libselinux-3.10/src'
make[1]: *** [Makefile:54: all] Error 1
make[1]: Leaving directory '/home/unfrobbed-dev/pkgs/libselinux/libselinux-3.10'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions