From patchwork Tue Aug 1 05:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 128998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2470049vqg; Mon, 31 Jul 2023 23:11:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxTJzlLKxZMfX1n7UHhu3HFBCIk7MWx3kK0JcoyqcN6d2XCemoHCTxJYdLJm0v2OWHmpAB X-Received: by 2002:a05:6a00:2352:b0:687:1a86:7a78 with SMTP id j18-20020a056a00235200b006871a867a78mr10577536pfj.9.1690870267546; Mon, 31 Jul 2023 23:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690870267; cv=none; d=google.com; s=arc-20160816; b=eup31DxF+TeEg931b+Fh4m6sjOLW1rgAc5yTK05MhS/qkpyQ1UFzBDIlcpwOM3qBT3 X76c1cKqaxdhDQaSK849WzXShLxzVh/Z8kZZl5IvgKN8ZDPzsMzWpxrZEoU0tKn+eiKL NrKqsgOVqlvy4Oseyxe5O+Bw9BJSccl3NRvznHR0NpXSHfNhtkHmfuoPqZqR6ZgW5Sr4 X7ZvPPR/cYQU4q7Ic4lebZZ8lv/1MRhg+XdcRTytZ0nFgIlo8/UCpwYyH7esrge05rh+ 6WosyiD2mA+M3eSkxQC9AFx3pzASeiPsVAhd5pWYLhrHxXfIQqWVFk0itq6Va6C/19S8 vrQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qxqZl5+ySp1g0dyoRBVnM+lVu74AF28hyBH5zvvO+r8=; fh=UZfhiU2pgwvZdBOe9fFEhnfTQX0/6KsvXKQubWsfhik=; b=sNVz+nUnSTJ4owgyLfAk1Dt0Gs++fhl+Tvs4/RQ6QbZRzyrdce7gtUnBDH2f3iRSSl WqO7cDqqhrDp+GT9bj3WPRpTeWvMgcYGLDw8jlEa9bUm2fJ7Sv/6wH7w0EwvB1v5ORRX QGCzNKIr31XB6rpJTV+/ICJBFfLs8fZ9P7Z9OtRpBN2+1arFrNYT/GCHTSd+Ut+yjYbZ vuXwRDP5vQRzNPPZeQ4WsAB0iYvMHBxDvglJkmSt8BVZapg4fMaCgjTs65qU8K2aK2XZ 4VJIAjwA8QAvCjbQvmi2mBChrVY7D8nl4ut7uwPVBrv7j/upBWujR3Tg1BWeEKqBWXjR VVTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cIt+g1aA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b66-20020a633445000000b005641dfc74d0si6329930pga.601.2023.07.31.23.10.55; Mon, 31 Jul 2023 23:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cIt+g1aA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbjHAFab (ORCPT + 99 others); Tue, 1 Aug 2023 01:30:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjHAFaV (ORCPT ); Tue, 1 Aug 2023 01:30:21 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 145031BF1; Mon, 31 Jul 2023 22:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690867812; bh=K1nxWE0fnm2Rd+ee1CtTMEzoebCOmluJAHtmf4S2JYw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cIt+g1aA+jbm6fXI+/dPh2DuwqkoKOOo4wP+v0r+PducTtkw+/Hva1UQ5XBBBqTPH xdjYo7Su6Yf1Dn/C6onQtRLZDAX9APRXi2kFZzWxTu4E8o1G3ASEn/Ecg1F2OS/7wi YzmVUoTN8hYPTULKPmDDTqzc3xQe5J+7Kqyoylqg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 01 Aug 2023 07:30:10 +0200 Subject: [PATCH v2 03/10] tools/nolibc: stdint: use int for size_t on 32bit MIME-Version: 1.0 Message-Id: <20230801-nolibc-warnings-v2-3-1ba5ca57bd9b@weissschuh.net> References: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net> In-Reply-To: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan , Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690867811; l=1072; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=K1nxWE0fnm2Rd+ee1CtTMEzoebCOmluJAHtmf4S2JYw=; b=ZyMAlp1fnMw5VR86DHSU2eD2euSXRI/6caWE9TNe6th9+CHufDYJ1f+j9pRXLM9tMXSXEP4Mb iQk6ibEQH0oBpfYcs26MtSjoWM0HJzl4CdfjtL5bBv8mVr9Jw/HUmse X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_HELO_TEMPERROR,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773005981659509831 X-GMAIL-MSGID: 1773005981659509831 Otherwise both gcc and clang may generate warnings about type mismatches: sysroot/mips/include/string.h:12:14: warning: mismatch in argument 1 type of built-in function 'malloc'; expected 'unsigned int' [-Wbuiltin-declaration-mismatch] 12 | static void *malloc(size_t len); | ^~~~~~ Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdint.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/include/nolibc/stdint.h b/tools/include/nolibc/stdint.h index 4b282435a59a..0f390c3028d8 100644 --- a/tools/include/nolibc/stdint.h +++ b/tools/include/nolibc/stdint.h @@ -15,7 +15,11 @@ typedef unsigned int uint32_t; typedef signed int int32_t; typedef unsigned long long uint64_t; typedef signed long long int64_t; +#if __SIZE_WIDTH__ == 64 typedef unsigned long size_t; +#else +typedef unsigned int size_t; +#endif typedef signed long ssize_t; typedef unsigned long uintptr_t; typedef signed long intptr_t;