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

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

commit 90f14100fe8a1e83b87746e30352220eeeb4a9be
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-06-09 21:19 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:19 UTC (permalink / raw)
  To: glibc-cvs

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

commit 73959e7f96ce4bb70e09e6c8689ff768d283d06c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 53e865e74a..7b294756e5 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-06-09 13:15 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=73959e7f96ce4bb70e09e6c8689ff768d283d06c

commit 73959e7f96ce4bb70e09e6c8689ff768d283d06c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 53e865e74a..7b294756e5 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-06-03 14:05 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:05 UTC (permalink / raw)
  To: glibc-cvs

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

commit 497a1024741fcdace50ec63f0e053b4a7cf04cf1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-05-13 14:18 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=897801d046e34907e6bfac26d81b895010c726ab

commit 897801d046e34907e6bfac26d81b895010c726ab
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-05-12 19:32 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=d3b6fc85418d83c6f57132be475ee332a11684e4

commit d3b6fc85418d83c6f57132be475ee332a11684e4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-05-10 18:23 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:23 UTC (permalink / raw)
  To: glibc-cvs

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

commit 3f4e03a5bf3ec87f588b833cee285e3078d198eb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-04-29 14:02 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=cd29c51c0c5c5eca6fb9607e717912719ced1643

commit cd29c51c0c5c5eca6fb9607e717912719ced1643
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-31 19:05 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=876e8c13d1245edfad3306095a538ec99fb1da43

commit 876e8c13d1245edfad3306095a538ec99fb1da43
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-29 20:28 Adhemerval Zanella
  0 siblings, 0 replies; 14+ 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=e9aba8dfa2ca830c2b2a6effc992e76617477601

commit e9aba8dfa2ca830c2b2a6effc992e76617477601
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-16 18:01 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:01 UTC (permalink / raw)
  To: glibc-cvs

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

commit d6f08b09afaa4ef85a4d72b1d57ba3de8fc94a92
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-15 18:39 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:39 UTC (permalink / raw)
  To: glibc-cvs

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

commit d6f08b09afaa4ef85a4d72b1d57ba3de8fc94a92
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-11 17:23 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:23 UTC (permalink / raw)
  To: glibc-cvs

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

commit 1d89afe46bf682a9ca8a681d12802fbecd6c7748
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

* [glibc/azanella/clang] iconvdata: Suppress warning on clang
@ 2022-03-10 19:22 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-10 19:22 UTC (permalink / raw)
  To: glibc-cvs

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

commit 4b59a34784d7c94e1f6725bb4c0ea6e6999a7d1d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 10:01:09 2022 -0300

    iconvdata: Suppress warning on clang

Diff:
---
 iconvdata/gbk.c             |  5 +++++
 iconvdata/iso-2022-cn-ext.c | 16 +++++-----------
 iconvdata/iso-2022-cn.c     |  5 +++++
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index 97717181f4..de910b3da6 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
   }
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'unsigned int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index e09f358cad..7d84560b42 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -387,6 +387,10 @@ enum
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -394,16 +398,6 @@ enum
 #define MIN_NEEDED_OUTPUT	TO_LOOP_MIN_NEEDED_TO
 #define MAX_NEEDED_OUTPUT	TO_LOOP_MAX_NEEDED_TO
 #define LOOPFCT			TO_LOOP
-/* With GCC 5.3 when compiling with -Os the compiler emits a warning
-   that buf[0] and buf[1] may be used uninitialized.  This can only
-   happen in the case where tmpbuf[3] is used, and in that case the
-   write to the tmpbuf[1] and tmpbuf[2] was assured because
-   ucs4_to_cns11643 would have filled in those entries.  The difficulty
-   is in getting the compiler to see this logic because tmpbuf[0] is
-   involved in determining the code page and is the indicator that
-   tmpbuf[2] is initialized.  */
-DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
 #define BODY \
   {									      \
     uint32_t ch;							      \
@@ -655,7 +649,6 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
     /* Now that we wrote the output increment the input pointer.  */	      \
     inptr += 4;								      \
   }
-DIAG_POP_NEEDS_COMMENT;
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
 				int ann = (*setp >> 3) & ~CURRENT_MASK
@@ -669,6 +662,7 @@ DIAG_POP_NEEDS_COMMENT;
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>
diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c
index 9d605fe11c..0de18c5753 100644
--- a/iconvdata/iso-2022-cn.c
+++ b/iconvdata/iso-2022-cn.c
@@ -227,6 +227,10 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+/* clang issues an warning adding 'int' 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");
 
 /* Next, define the other direction.  */
 #define MIN_NEEDED_INPUT	TO_LOOP_MIN_NEEDED_FROM
@@ -401,6 +405,7 @@ enum
 #define UPDATE_PARAMS		*setp = set | ann
 #include <iconv/loop.c>
 
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 /* Now define the toplevel functions.  */
 #include <iconv/skeleton.c>


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

end of thread, other threads:[~2022-06-09 21:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 12:53 [glibc/azanella/clang] iconvdata: Suppress warning on clang Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2022-06-09 21:19 Adhemerval Zanella
2022-06-09 13:15 Adhemerval Zanella
2022-06-03 14:05 Adhemerval Zanella
2022-05-13 14:18 Adhemerval Zanella
2022-05-12 19:32 Adhemerval Zanella
2022-05-10 18:23 Adhemerval Zanella
2022-04-29 14:02 Adhemerval Zanella
2022-03-31 19:05 Adhemerval Zanella
2022-03-29 20:28 Adhemerval Zanella
2022-03-16 18:01 Adhemerval Zanella
2022-03-15 18:39 Adhemerval Zanella
2022-03-11 17:23 Adhemerval Zanella
2022-03-10 19:22 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).