From patchwork Wed May 1 11:35:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1930126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SKpxgCOY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTw4R72pYz1ymp for ; Wed, 1 May 2024 21:36:07 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 4D5BF35282F5; Wed, 1 May 2024 13:35:52 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SKpxgCOY; dkim-atps=neutral Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by helium.openadk.org (Postfix) with ESMTPS id EA21935208EF for ; Wed, 1 May 2024 13:35:42 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-41b79451153so38328635e9.2 for ; Wed, 01 May 2024 04:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714563341; x=1715168141; darn=uclibc-ng.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T0thHhpmFHNr2rw+IvqmWgUMrNQtc0IsN/1JmTOjfDs=; b=SKpxgCOYYJXXb6NzHCMt6faF1JnUQaFkbGt7HdhttCh5ZMxtd+2UjGGs2Ae/cGVLvg ibib6nFDfxkU3mQs5LgVKUVmHLs4KC5g9prhCSA72xEQvTGG1UKy/Ab5hhxBl2a0yxBS XiXRImPmmU9cZpo/QDPscjnKyxHyGW5qY3hD6ZjdYs3QWBTlo6TZnncw37InHZqaMZQZ 5Iv+MoXPdTU7Vej/ZPjVBJdPiVU6BUTGo83ZmgHLpUAj7xfIdpSCAz7aLYNa/PvE6pV+ 7QbbNXEX0vMI4fEKHHNTy+7Xu66bc/5ooOOZXfLsb+uX9LKmHRRaacB6RsBH5YDwofEJ nCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714563341; x=1715168141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T0thHhpmFHNr2rw+IvqmWgUMrNQtc0IsN/1JmTOjfDs=; b=Ss3IbRerylbpZr5AlmVNEBbu2SHsCtsVe3lcd5BrwbDSg5nXuOzMf9FaymDTzUkgUV sMKWHXDkru/n6eYXrt7pUQpw6nNJzLOleApM0BpSmR8v7rxc/FZfJQQF9GipYO901yjK /f7kaLa/Wk4n7YAgb83U2NwhG4JKckS5ckD61XACYSkffICcL8tRKI18kbgz4VW7gIc5 WACX/0fZyQyOR+AYp/EKL7ACbzaK6queCcAj+0lvbXaIV1JxLYn0SE71POZzlC3xWr1R ImZVdN4tklgXBTZbHkOJAEzjx+rCELCpGNbiNAvu5DZC3ErOEhF9/Oxrg5XEl9XbrahN Lc1g== X-Gm-Message-State: AOJu0YyBcht5hnBTXJJyni6QCqZ2zGXK9QFhrFrw31jWRVcZXSC84dP7 g/Q/Ks45SWrIubpaZrUEj2NQHmBpxJsQxYacsvqI4TQI0/uQv00nQPRSXg== X-Google-Smtp-Source: AGHT+IHIBxHNkzvEGvw9Jlf+cu0MN7LAMZMNyrOH1kIVvfXFl5eLcgZKIdY+lQs9k9VIxQBhxH0pwg== X-Received: by 2002:a05:600c:1e26:b0:41b:6753:30be with SMTP id ay38-20020a05600c1e2600b0041b675330bemr1580312wmb.38.1714563341273; Wed, 01 May 2024 04:35:41 -0700 (PDT) Received: from octofox.metropolis (77-46-212-180.dynamic.isp.telekom.rs. [77.46.212.180]) by smtp.gmail.com with ESMTPSA id u17-20020a05600c19d100b0041bb11ff5a7sm1942113wmq.8.2024.05.01.04.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 04:35:40 -0700 (PDT) From: Max Filippov To: devel@uclibc-ng.org Date: Wed, 1 May 2024 04:35:18 -0700 Message-Id: <20240501113520.1123290-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240501113520.1123290-1-jcmvbkbc@gmail.com> References: <20240501113520.1123290-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 5RS5SCGY6ZRHW75MPKOCGP2YDSJ254EU X-Message-ID-Hash: 5RS5SCGY6ZRHW75MPKOCGP2YDSJ254EU X-MailFrom: jcmvbkbc@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 1/3] iconv: fix type mismatches List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: With gcc-14 warnings caused by type mismatches turn to errors: - iconv_t is not a pointer type, convert the result directly to iconv_t in combine_to_from() - unsigned int is not the same as wchar_t, use temporary wchar_t wc as an argument for utf8dec_wchar() Signed-off-by: Max Filippov --- libiconv/iconv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libiconv/iconv.c b/libiconv/iconv.c index ec01f381dbf4..0462f6e1080d 100644 --- a/libiconv/iconv.c +++ b/libiconv/iconv.c @@ -142,7 +142,7 @@ struct stateful_cd { static iconv_t combine_to_from(size_t t, size_t f) { - return (void *)(f<<16 | t<<1 | 1); + return (iconv_t)(f<<16 | t<<1 | 1); } static size_t extract_from(iconv_t cd) @@ -382,7 +382,11 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri switch (type) { case UTF_8: if (c < 128) break; - l = utf8dec_wchar(&c, *in, *inb); + else { + wchar_t wc; + l = utf8dec_wchar(&wc, *in, *inb); + c = wc; + } if (!l) l++; else if (l == (size_t)-1) goto ilseq; else if (l == (size_t)-2) goto starved;