]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss: Suppress clang -Wstring-plus-int on __nss_shlib_revision definition
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Mar 2022 11:31:06 +0000 (08:31 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:36:26 +0000 (13:36 -0300)
clang issues an warning that adding 'unsigned long' to a string does not
append to the string.

nss/nss_module.c

index 3cd1940b225366f9e7f5d5dad0b413328e99d368..ac94e4d3f02d80c098f6a6dab53392c9f9386e66 100644 (file)
@@ -41,7 +41,7 @@
    pointer manipulation.  The "-1" accounts for the trailing NUL
    included in the sizeof.  */
 static const char *const __nss_shlib_revision
-       = LIBNSS_FILES_SO + sizeof("libnss_files.so") - 1;
+       = &LIBNSS_FILES_SO[sizeof("libnss_files.so") - 1];
 
 /* A single-linked list used to implement a mapping from service names
    to NSS modules.  (Most systems only use five or so modules, so a