Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1226337lqd; Thu, 25 Apr 2024 09:11:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0wN5tHTjiuDtWFlt7Yfoj2HJ28HzFx2jAqcgZF0WMXkNo8ppcnR8XXIPNnJMO0RcsNiFZElGH4qqxmrTBAH+mhwNCMzKNlzhlIM77/w== X-Google-Smtp-Source: AGHT+IEIGEFIoWULcjTDsCnfmTqViTE/RJCTFmr2a3uInOCe1o+W5PdqyB4dhEPtOxk7LJZ49uC4 X-Received: by 2002:a17:906:3102:b0:a58:9707:6857 with SMTP id 2-20020a170906310200b00a5897076857mr165628ejx.12.1714061464231; Thu, 25 Apr 2024 09:11:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714061464; cv=pass; d=google.com; s=arc-20160816; b=eKSkkPgX2dxpjPFAOTHrUfGMkC9wa/NShj9AYj6bj3idMN1UzRBuPcL9ckdTYMNDOu TJKQYxrKO39pAQIXlh3AWUQBWws6SkdqBe00qtk7LgTsdz1NeCEZioOqxMiyW37II74e 2RVZPupQqHGVhcXxwcqhsBlJsbg+JxZsbkIS+QkNrp7/c5paOovGY67CfkCwLccPVZka 87rGY4vpvSWFh4xWvuTRTyRyXDXCPR0PSqXDepyMqt7SFddEA1Q/LTagPj8MoPqXAqxu 68kUkmqWZr9HvIXfvGxhiYLz5qNM9kTCTxTB4cADwSMPj1ePne+3XYwnBiKqxCm6pohC pPlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ddmEDqGdPjaKlQBv9kkDCycuyxq8YtipAkRrtiH4CC0=; fh=Qbk0RS4bf6GjbhGkpgFoVgYg5V+1DfWcZ6CAErfO2MQ=; b=EhOI/Tyjub+bwk8FEzG/ycFno9btjD5EyqvZNdS4K5bRFmwfMJUfBylDLc36K5RgdU 9KtXsxU69nPgJdq8Ord1v+pTsZtNL7EPxJoeCbJ7uRbU7eZXRSHK977qBldYAdRzL/NE 9rfrwKvIF8Ii8CyOcdBpPun77iyIr9r2SFraSVtfeZdM2jFvOe7z1G3I3CJrCd/9TyFN E86I7e16Qg9TLtqr5RSSaD2lXmUAQ6Z4n+cfqd5LuMvojFB44EYcKNerpcU8SmUBxG6p LCKdxqqk7FaLYQmYakc0VANxGVWU+8sJU982Y3COW+qvx1E70pp1gTyVRxfInE1YDm3h LnJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=pHvvMuiB; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-158871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158871-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kh6-20020a170906f80600b00a5884e380b1si3149499ejb.649.2024.04.25.09.11.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 09:11:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=pHvvMuiB; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-158871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158871-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A46371F2350F for ; Thu, 25 Apr 2024 16:11:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05A2714D422; Thu, 25 Apr 2024 16:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="pHvvMuiB" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0571814C58E; Thu, 25 Apr 2024 16:09:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714061400; cv=none; b=c0gXfOFeDXZ9fMSgLAlifgbRk8W7TqlRf39Y+4REmCZgIgVrTWyCcZWNL1+lvolN3p08l6nAEY12JfRsvUz26X7nKjJOEP0a0WC6yrl87Y0DqwovqWnQ+ySI2ra9DQ5XocvA6bdqTl+QMWizPEyDT136a2Dnu3dobrIcWMAYITs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714061400; c=relaxed/simple; bh=8tM3DH8oxEqa4sOJHdQ9/tQtwJ1j7MGZxLZSkBO70pI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=scW2P3qupbvin1A8VyUnZ+bEiSSqYRfb6m1sfmcI6hyJbtcCHWVDAUKAKCJj1536b3Tei0JiTqA+wnENpEN97UQgkE5QtupdhJ+izzzFScjWkhjP2yFkWQSEcp0niJ5GqrbfBLAFU3/lQdnM7EEJDOCoYihvabrM599aKdy/xUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=pHvvMuiB; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1714061393; bh=8tM3DH8oxEqa4sOJHdQ9/tQtwJ1j7MGZxLZSkBO70pI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pHvvMuiBHc0et/KIiwysnGMYMpvUMebecoj/ymo1Tyo0WJceyFQcVywUfJmyRdoJl FuEzvZmwPug9NlfjChEGBugWL5y3NeGFH2r5N4NTMHCcJPmvH5hI2TryKNAFuvGNmB /C0kg/75CkLHP2Q4knBeGj32AAsQnrHSkcUvaDDU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 25 Apr 2024 18:09:26 +0200 Subject: [PATCH 1/2] tools/nolibc: add limits for {u,}intmax_t, ulong and {u,}llong Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240425-nolibc-strtol-v1-1-bfeef7846902@weissschuh.net> References: <20240425-nolibc-strtol-v1-0-bfeef7846902@weissschuh.net> In-Reply-To: <20240425-nolibc-strtol-v1-0-bfeef7846902@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714061393; l=1268; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=8tM3DH8oxEqa4sOJHdQ9/tQtwJ1j7MGZxLZSkBO70pI=; b=63sr3XikAp5KBx6TgGfCxWFCGkN61MfltSj9ZTXvR9fB1AZ+ROBxWLoIZw2Ax/mbT3iet/b+F bOntliogisAD2OwMHbo287uR5xOGRC412oMO9sGAE9DhbIxVtl1XtDx X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= They are useful for users and necessary for strtol() and friends. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdint.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/include/nolibc/stdint.h b/tools/include/nolibc/stdint.h index 6665e272e213..cd79ddd6170e 100644 --- a/tools/include/nolibc/stdint.h +++ b/tools/include/nolibc/stdint.h @@ -96,6 +96,10 @@ typedef uint64_t uintmax_t; #define UINT_FAST32_MAX SIZE_MAX #define UINT_FAST64_MAX UINT64_MAX +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + #ifndef INT_MIN #define INT_MIN (-__INT_MAX__ - 1) #endif @@ -110,4 +114,19 @@ typedef uint64_t uintmax_t; #define LONG_MAX __LONG_MAX__ #endif +#ifndef ULONG_MAX +#define ULONG_MAX ((unsigned long)(__LONG_MAX__) * 2 + 1) +#endif + +#ifndef LLONG_MIN +#define LLONG_MIN (-__LONG_LONG_MAX__ - 1) +#endif +#ifndef LLONG_MAX +#define LLONG_MAX __LONG_LONG_MAX__ +#endif + +#ifndef ULLONG_MAX +#define ULLONG_MAX ((unsigned long long)(__LONG_LONG_MAX__) * 2 + 1) +#endif + #endif /* _NOLIBC_STDINT_H */ -- 2.44.0