From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id C1A983858C39; Fri, 9 Feb 2024 17:29:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1A983858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707499784; bh=7tb6WNEy1NVdQy5BRugk6WD1ujpvXudgtsDe4yvpDUM=; h=From:To:Subject:Date:From; b=ubFBkoy/Oc0gKmadzTN0FSAMMFnmG76P2Bxrs0fA4Hg0ccUcknB1l9mxFEoNtYJl2 /XWuHXuwV+3/ez26idJ7Z/gNjZs9IwYhhmZBpu61fH2KlHA/jEj9l3KlmLbjpYG8RO qFsDPhIYqQtpqzM3Y0CjTP/uia3g/23bR/q76LfI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: f4dc4f5e627cf743f1eb9e96ccf00d270df0eebc X-Git-Newrev: cf35062ce9c4a85996f4c0b989a1b0fbb1dd9033 Message-Id: <20240209172944.C1A983858C39@sourceware.org> Date: Fri, 9 Feb 2024 17:29:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cf35062ce9c4a85996f4c0b989a1b0fbb1dd9033 commit cf35062ce9c4a85996f4c0b989a1b0fbb1dd9033 Author: Adhemerval Zanella Date: Thu Mar 10 08:31:06 2022 -0300 nss: Suppress nss_module.c warning on clang clang issues an warning adding 'unsigned long' to a string does not append to the string, however it is exactly what code means here. Diff: --- nss/nss_module.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nss/nss_module.c b/nss/nss_module.c index 32ab8921a0..32d3f01b4f 100644 --- a/nss/nss_module.c +++ b/nss/nss_module.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include /* Suffix after .so of NSS service modules. This is a bit of magic, but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we @@ -40,8 +42,14 @@ except through the auto-generated lib-names.h and some static pointer manipulation. The "-1" accounts for the trailing NUL included in the sizeof. */ + +/* clang issues an warning adding 'unsigned long' to a string does not append + to the string, however it is exactly what code means here. */ +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); static const char *const __nss_shlib_revision = LIBNSS_FILES_SO + sizeof("libnss_files.so") - 1; +DIAG_POP_NEEDS_COMMENT_CLANG; /* 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