public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2024-02-09 17:28 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:28 UTC (permalink / raw)
  To: glibc-cvs

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

commit 5a30a64e0b2d35712f35821b8f23f0f38308ef07
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index 4b1c916756..7666a386f3 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2024-04-17 20:04 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:04 UTC (permalink / raw)
  To: glibc-cvs

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

commit e182dc08d71c8268495acc1a980a7fb57fa84103
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index 4b1c916756..7666a386f3 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2024-04-02 15:50 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:50 UTC (permalink / raw)
  To: glibc-cvs

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

commit 3911c52da84faa4a859669691d015a011133ebe9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index 4b1c916756..7666a386f3 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2024-02-07 14:04 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:04 UTC (permalink / raw)
  To: glibc-cvs

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

commit c024a249e2964851d7dd7b09975f4d7984a1ab29
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index 4b1c916756..7666a386f3 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2024-01-29 17:54 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:54 UTC (permalink / raw)
  To: glibc-cvs

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

commit 34ba47230eb87f570953eb9bc2a6ab2ad01b245c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index 4b1c916756..7666a386f3 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2023-12-21 18:50 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:50 UTC (permalink / raw)
  To: glibc-cvs

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

commit 7451d5a8944fc0e153f9c8f2a547c2e0e8c32b61
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index dada76a51d..a82e9775dd 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

* [glibc/azanella/clang] Add clang specific warnings suppress macros
@ 2023-09-28 17:49 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:49 UTC (permalink / raw)
  To: glibc-cvs

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

commit 9175344b69f63546b020cc150cf1805a3ecbf5e9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Sep 12 15:45:24 2023 -0300

    Add clang specific warnings suppress macros
    
    Four new macros are added:
    
      * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
        DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
        handle warnings for options only supported by clang.
    
      * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
        DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
        for the referenced compiler.

Diff:
---
 include/libc-diag.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/libc-diag.h b/include/libc-diag.h
index dada76a51d..a82e9775dd 100644
--- a/include/libc-diag.h
+++ b/include/libc-diag.h
@@ -38,6 +38,16 @@
 /* Pop diagnostic state.  */
 #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
 
+/* These macros are used to push/pop diagnostic states for warnings only
+   supported by clang.  */
+#ifdef __clang__
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push")
+# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop")
+#else
+# define DIAG_PUSH_NEEDS_COMMENT_CLANG
+# define DIAG_POP_NEEDS_COMMENT_CLANG
+#endif
+
 #define _DIAG_STR1(s) #s
 #define _DIAG_STR(s) _DIAG_STR1(s)
 
@@ -71,4 +81,16 @@
 # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
 #endif
 
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used
+   to suppress warning supported by the specific compiler.  */
+#ifndef __clang__
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \
+  DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option)
+#else
+# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING)
+# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \
+  _Pragma (_DIAG_STR (clang diagnostic ignored option))
+#endif
+
 #endif /* libc-diag.h */

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

end of thread, other threads:[~2024-04-17 20:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 17:28 [glibc/azanella/clang] Add clang specific warnings suppress macros Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:04 Adhemerval Zanella
2024-04-02 15:50 Adhemerval Zanella
2024-02-07 14:04 Adhemerval Zanella
2024-01-29 17:54 Adhemerval Zanella
2023-12-21 18:50 Adhemerval Zanella
2023-09-28 17:49 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).