Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1235492rwb; Sat, 5 Aug 2023 09:58:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZWSJo9Zeachubrf08bMEXNn5H9R0IjBEcO+qbHloxqR5hthbEHdO5Iks/71+W/ORpYSwy X-Received: by 2002:a05:6a21:3d85:b0:13b:cc09:a547 with SMTP id bj5-20020a056a213d8500b0013bcc09a547mr6131281pzc.36.1691254704576; Sat, 05 Aug 2023 09:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691254704; cv=none; d=google.com; s=arc-20160816; b=d8RhbcDEIBK195yawZOoZc/Et31O3ZEQIfaqY4ILZi/6SN9fMHi3sBEXTt5lTakYLD +PYs4HqzgWMCjw/0p0oSzf2Oitz1X3aL66U8An5H0q+kgFxyI05Um7lWyOwCZ4wYtBgf B4rqaupFInyJyOzb3liOfyqU2EdVr2HslbIqyqbYtrcM7wRJXF5YTkByaMywgvpnYiLI rr3kMM5EcIxY69TC8ixtU3h2n3GCN1GWOBDCaIEbm2c7rbY1p2aqAUJ3Lit07osS32RQ NIT7tcsbSWpv+h7ZDPLW/0MsZwf1wKStjHYWRHqn2BJfDQ2iakRmFbL828gW6KYwB0/+ QiiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nIM51Wr7WFbGcE/m1i7srxocS7Qu8S44Rgpm9u1jQhY=; fh=TTF1lt49Sby0rKay1qRjEqWFbUkg3/0Ba8LROUDUaGE=; b=CkSXvG9RexkhpWIzb1c2zvvsj86g/jbwCC6W8aAsSFBhOhVzbYO7xZW+ZB8jZPn1FG NW0i/HGkTmB7G4H7xD0O8xuc0Sn4FhS4XymHlPtrsEyqHPIrnC8w2ETfkHzmmswVPDBW f9k85tX6Ip+FlPYDTgu14q62K41oL0rSsHwPxXsJVA/AXsUCTl1AlTwTRsDIMuqZBQDP TbfEDZ4auPMexL8QYUGy3LiGtXQz+QczRaePgh2cx7Atv/c0pP5m9Qx7wXED7tJFzYbZ 2M7TwpdU34sew4DBHtnNVHMEFM2iHFeICUmPsUHKHnlbsVVf3hBx0EnfMay0Eow8rize uC7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a056a001d9000b0067f69d10241si3306787pfw.176.2023.08.05.09.58.13; Sat, 05 Aug 2023 09:58:24 -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; 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 S229641AbjHEQUG (ORCPT + 99 others); Sat, 5 Aug 2023 12:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjHEQUF (ORCPT ); Sat, 5 Aug 2023 12:20:05 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E7F8F10F8; Sat, 5 Aug 2023 09:20:02 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 375GJT91022197; Sat, 5 Aug 2023 18:19:29 +0200 Date: Sat, 5 Aug 2023 18:19:29 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan , Zhangjin Wu Subject: Re: [PATCH v3 05/14] tools/nolibc: stdint: use int for size_t on 32bit Message-ID: <20230805161929.GA15284@1wt.eu> References: <20230803-nolibc-warnings-v3-0-bcc1a096ae02@weissschuh.net> <20230803-nolibc-warnings-v3-5-bcc1a096ae02@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230803-nolibc-warnings-v3-5-bcc1a096ae02@weissschuh.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 Hi Thomas, On Thu, Aug 03, 2023 at 09:28:49AM +0200, Thomas Wei?schuh wrote: > 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 This one breaks gcc < 7 for me because __SIZE_WIDTH__ is not defined there. However I could trace __SIZE_TYPE__ to be defined since at least gcc-3.4 so instead we can do this, which will always match the type set by the compiler (either "unsigned int" or "unsigned long int") : #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ size_t; #else typedef unsigned long size_t; #endif Please just let me know if you want me to modify your patch accordingly. I'm still continuing the tests. Thanks, Willy