public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-05-12 19:32 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b4b01df6545cfda3c3c9dc0462a76bdeed2f941

commit 0b4b01df6545cfda3c3c9dc0462a76bdeed2f941
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2024-02-09 17:29 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:29 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cf35062ce9c4a85996f4c0b989a1b0fbb1dd9033

commit cf35062ce9c4a85996f4c0b989a1b0fbb1dd9033
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2024-02-07 14:05 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=353a51546c1c6a60f440a5fb01886bb4472cc58d

commit 353a51546c1c6a60f440a5fb01886bb4472cc58d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2024-01-29 17:55 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:55 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a4e99e17b866783cd6998b6afd2be078a4849eef

commit a4e99e17b866783cd6998b6afd2be078a4849eef
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2023-12-21 18:51 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:51 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4edf9318955b276f0376cc66ccb06981ac6a82bb

commit 4edf9318955b276f0376cc66ccb06981ac6a82bb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 0104f88974..ee99598e70 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2023-09-28 17:50 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f7dcf1d25101403e1fe83c8b5c882ee4287843b

commit 8f7dcf1d25101403e1fe83c8b5c882ee4287843b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 0104f88974..ee99598e70 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2023-08-30 12:34 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=36fb5ff6c6453a7587d00f34b0fdfe190ae78885

commit 36fb5ff6c6453a7587d00f34b0fdfe190ae78885
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 nss/nss_module.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nss/nss_module.c b/nss/nss_module.c
index 0104f88974..ee99598e70 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2023-02-09 19:46 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a7b5bf5cbf1bc117b6e78b5e684f4e38b1241132

commit a7b5bf5cbf1bc117b6e78b5e684f4e38b1241132
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 nss/nss_module.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nss/nss_module.c b/nss/nss_module.c
index 487e513def..c92b409e8f 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-10-28 17:39 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:39 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5388f8e9fbea34649846431797f24ca0b5c131fa

commit 5388f8e9fbea34649846431797f24ca0b5c131fa
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 nss/nss_module.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nss/nss_module.c b/nss/nss_module.c
index 444facb9b8..31ae3156de 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pointer_guard.h>
+#include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-10-04 12:57 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:57 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6db1195237f5079acd1e63dec04a21be81c939fe

commit 6db1195237f5079acd1e63dec04a21be81c939fe
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 nss/nss_module.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-06-09 21:18 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:18 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e5a6a196751287427805bc623c3d1e166cc8012c

commit e5a6a196751287427805bc623c3d1e166cc8012c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-06-09 13:15 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e5a6a196751287427805bc623c3d1e166cc8012c

commit e5a6a196751287427805bc623c3d1e166cc8012c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-06-03 14:04 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a94897810c26e7adfa0519ee2c64f753200a3624

commit a94897810c26e7adfa0519ee2c64f753200a3624
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-05-13 14:18 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:18 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=713a0e1890c11b34cc1d3ea8f117b63a6aaf15bc

commit 713a0e1890c11b34cc1d3ea8f117b63a6aaf15bc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-05-10 18:22 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:22 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fc1d7196e71c061cf110b541bdf422a69de8caa

commit 2fc1d7196e71c061cf110b541bdf422a69de8caa
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-04-29 14:02 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:02 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=20ad70998b8fb4cdab5e4a4a7a064cc51c42dfc5

commit 20ad70998b8fb4cdab5e4a4a7a064cc51c42dfc5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-04-04 12:52 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:52 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=316431b8391fd266aa6b22dfbcb5b09d7cf728d1

commit 316431b8391fd266aa6b22dfbcb5b09d7cf728d1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-31 19:05 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2009ec1584695a3a859796d16e61660d37d3b062

commit 2009ec1584695a3a859796d16e61660d37d3b062
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-29 20:28 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:28 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5ea34ddb20eb30be79837d4a8fd2194dd0d2f22f

commit 5ea34ddb20eb30be79837d4a8fd2194dd0d2f22f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index e1dbe99eb3..61e33d6c36 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-16 18:00 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:00 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6dcc169294999ab13a8eb8d7e2feef2af6c0c7b9

commit 6dcc169294999ab13a8eb8d7e2feef2af6c0c7b9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index bc273716e3..182d640a2e 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_MAYBE_UNINITIALIZED(VERSION) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-15 18:38 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6dcc169294999ab13a8eb8d7e2feef2af6c0c7b9

commit 6dcc169294999ab13a8eb8d7e2feef2af6c0c7b9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index bc273716e3..182d640a2e 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_MAYBE_UNINITIALIZED(VERSION) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f00bbd9e1a..852dc991b4 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-11 17:22 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:22 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9824fe4bc5ce01dc4b11980367231140e8e07d0f

commit 9824fe4bc5ce01dc4b11980367231140e8e07d0f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index bc273716e3..182d640a2e 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_MAYBE_UNINITIALIZED(VERSION) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f9a1263e5a..d2e5b7b88b 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang
@ 2022-03-10 19:21 Adhemerval Zanella
  0 siblings, 0 replies; 23+ messages in thread
From: Adhemerval Zanella @ 2022-03-10 19:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5a7d04f96c0bd7781cc25b60b2dfea0453380287

commit 5a7d04f96c0bd7781cc25b60b2dfea0453380287
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 08:31:06 2022 -0300

    nss: Suppress nss_module.c warning on clang

Diff:
---
 include/libc-diag.h | 13 +++++++++++++
 nss/nss_module.c    |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index bc273716e3..182d640a2e 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -71,6 +71,19 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Same as before, but only enables the warning suppression for clang.
+   It is for clang-only issues and options that only clang emits.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#endif
+
 /* Some warnings are not support for all compilers.  */
 #ifndef __clang__
 # define DIAG_IGNORE_NEEDS_COMMENT_MAYBE_UNINITIALIZED(VERSION) \
diff --git a/nss/nss_module.c b/nss/nss_module.c
index f9a1263e5a..d2e5b7b88b 100644
--- a/nss/nss_module.c
+++ b/nss/nss_module.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysdep.h>
+#include <libc-diag.h>
 
 /* 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 +41,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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-02-09 17:29 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 19:32 [glibc/azanella/clang] nss: Suppress nss_module.c warning on clang Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2024-02-09 17:29 Adhemerval Zanella
2024-02-07 14:05 Adhemerval Zanella
2024-01-29 17:55 Adhemerval Zanella
2023-12-21 18:51 Adhemerval Zanella
2023-09-28 17:50 Adhemerval Zanella
2023-08-30 12:34 Adhemerval Zanella
2023-02-09 19:46 Adhemerval Zanella
2022-10-28 17:39 Adhemerval Zanella
2022-10-04 12:57 Adhemerval Zanella
2022-06-09 21:18 Adhemerval Zanella
2022-06-09 13:15 Adhemerval Zanella
2022-06-03 14:04 Adhemerval Zanella
2022-05-13 14:18 Adhemerval Zanella
2022-05-10 18:22 Adhemerval Zanella
2022-04-29 14:02 Adhemerval Zanella
2022-04-04 12:52 Adhemerval Zanella
2022-03-31 19:05 Adhemerval Zanella
2022-03-29 20:28 Adhemerval Zanella
2022-03-16 18:00 Adhemerval Zanella
2022-03-15 18:38 Adhemerval Zanella
2022-03-11 17:22 Adhemerval Zanella
2022-03-10 19:21 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).