From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 2A4FB388A416; Fri, 28 Oct 2022 17:40:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A4FB388A416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666978829; bh=n+2JGxP0P3NNj5uYotWYhUy348/i4qYCP1DP87G8fmM=; h=From:To:Subject:Date:From; b=VJ7tRz6EnXN5L0joVnBviBLt4i9LpOnCuWpIeQfBlmBTeWErfCVT9TvGt73TPcrl5 /BsJvLi/SkvXXPzwJP8xi9JDrCYiAkx/S/TDadjYcdpX0KsJtJApp9o0TtYzA0Wu45 svxANf2c1hGdjQ+OyPxsDj/TbKOhtQw674YH0Lzo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] iconvdata: Suppress clang warning on locale definitions X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 8b05dbe2d21ff37e192ef7510309a09960d794af X-Git-Newrev: 1c992e8a735be0dae87ad70b95e068fe7ade3084 Message-Id: <20221028174029.2A4FB388A416@sourceware.org> Date: Fri, 28 Oct 2022 17:40:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1c992e8a735be0dae87ad70b95e068fe7ade3084 commit 1c992e8a735be0dae87ad70b95e068fe7ade3084 Author: Adhemerval Zanella Date: Thu Mar 10 10:01:09 2022 -0300 iconvdata: Suppress clang warning on locale definitions 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 +/* 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 +DIAG_POP_NEEDS_COMMENT_CLANG; /* Now define the toplevel functions. */ #include 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 +/* 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 +DIAG_POP_NEEDS_COMMENT_CLANG; /* Now define the toplevel functions. */ #include 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 +/* 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 +DIAG_POP_NEEDS_COMMENT_CLANG; /* Now define the toplevel functions. */ #include